Note that there are some explanatory texts on larger screens.

plurals
  1. POCall-time pass-by-reference deprecated?
    primarykey
    data
    text
    <p>I read in many forums to remove the ampersand (&amp;) before any $ listed in a variable, and I did, but doing so removes the functionality of the code I'm using. What should I do?</p> <p>Demo <a href="http://www.meggriffithsphotography.com/#portfolios.php" rel="nofollow">here</a>.</p> <p>Code here:</p> <pre><code>&lt;?php $val = $_GET['name']; $path = "./images/".$val."/"; $file_array = array (); readThisDir ( $path, &amp;$file_array ); echo '&lt;div class="gallery" style="display:block;" id="'.$val.'"&gt;'; echo '&lt;ul&gt;'; foreach ( $file_array as $file ) { if (strstr($file, "png")||strstr($file, "jpg")||strstr($file, "bmp")||strstr($file, "gif")) { list($width, $height) = getimagesize($file); $info = exif_read_data($file); echo '&lt;li&gt;&lt;a href="javascript:void(0);"&gt;&lt;img src="'.$file.'" width="'.$width.'" height="'.$height.'" alt="'.$file.'"/&gt;&lt;/a&gt;&lt;span&gt;'.$info['Title'].'&lt;div class="gallerynav"&gt;&lt;a href="javascript:void(0);" class="prevproject"&gt;&amp;laquo;&lt;/a&gt;&lt;a href="javascript:void(0);" class="nextproject"&gt;&amp;raquo;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;/li&gt;'; } } echo '&lt;/ul&gt;'; echo '&lt;/div&gt;'; function readThisDir ( $path, $arr ) { if ($handle = opendir($path)) { while (false !== ($file = readdir($handle))) { if ($file != "." &amp;&amp; $file != "..") { if (is_dir ( $path."/".$file )) { readThisDir ($path."/".$file, &amp;$arr); } else { $arr[] = $path."/".$file; } } } closedir($handle); } } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload