Printing raw field value to use in path to files I have field called "field_cat_id" which has a numerical value (10201; 10202 etc). The field represents a category id and it is also used to arrange PDF files, 

I would like to print this (raw) value and use it in the path as shown below in the snippet of my node.tpl.php: 

    &lt;?php
     $catid = print $content['field_cat_id'][0]['#markup'];
       $path = "/home/site/library/files/" . $catid . "/";// to switch to this once all is working
    $files = scandir($path); ?&gt;

    &lt;ul id="booklist"&gt;
      &lt;?php foreach ($files as &amp;$value) {
        echo "&lt;li&gt; &lt;a href='http://localhost/library/files/".$catid."/".$value."' &gt;".$value."&lt;/a&gt;&lt;/li&gt;";
    }?&gt;
    &lt;/ul&gt;


The output for $path comes out like this:

/home/site/library/files/1/


Where am i going wrong? When I run 

   &lt;?php print $content['field_cat_id'][0]['#markup']; ?&gt;


The output is for example "10201"
$catid = print $content['field_cat_id'][0]['#markup'];


Try removing the print.