php - HTTP error 500, not sure where to start -


<?php     $tabel = array();     $teller = 0;     $handle = opendir(dirname(realpath(__file__)).'/images/bbq2015/');         while($file = readdir($handle)){             if($file !== '.' && $file !== '..'){                 $tabel[$teller] = $file;                 $teller++;             }         }          $n = $tabel.length();         ($i = 0; $i < $n-1; $i++)         ($j = 0; $j < $n-$i-1; $j++)             if ($tabel[$j] > $tabel[$j+1])             {                 $temp = $tabel[$j];                 $tabel[$j] = $tabel[$j+1];                 $tabel[$j+1] = $temp;             }         $teller = 0;         while($teller < $n){             echo '<a class="example-image-link" href="images/bbq2015/'.$tabel[$teller].'" data-lightbox="example-set" data-title="bbq 2015"><img class="halloween2015" src="images/bbq2015/'.$tabel[$teller].'"/></a>';             $teller++;          } ?> 

i realise might not best code i'm trying. love know i'm making error, not looking code fixed.

change

$n= $tabel.length(); //there no length() function in php 

to

$n= count($tabel); 

count() returns number of elements in array.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -