Example on how to use php smarty foreach control structure

<p><!–StartFragment –>                       {foreach from=$advertiser_categories item=category}<br /> </p> <li><input id=”category_id_{$category}” type=”checkbox” name=”category_id[]” value=”{$category}” />{$category}</li> <p>                       <br /> {/foreach} Keywords: notes, code</p> Keywords: notes, code

PHP: Do not use fopen() to read XML files into xml_parse(

was using the following function to get a xml url from the web, create a handle,  read the content, and then feed it to xml_parse(): if (!($fp = fopen($xml_file, ‘r’))) {              die(’Cannot open XML data file: ‘.$xml_file); return false; } $bytes_to_parse = 1024; while ($data = fread($fp, $bytes_to_parse)) {            $parse = xml_parse($this->xml, $data, feof($fp)); if […]