Hi I have a feild in a MySql database called features. It is delimited by |
the line above the \ key.
Anyway, the feild has things like PS|PW|AC etc in it.
I have the code below to explode that feild. It all works fine, but when it
comes to looping the code below it always misses that last value. (Example -
AC)
Only in the IF statement - if i echo the variable "$feature" out of the IF
statment it prints the text fine. But i need it to check for the existance
of a gif first to display in the window.
As you will see I have gifs with the names and the variable $feature ends
with .gif
It works great, but it misses the last value to the array $feature.
Any ideas.

$specs = $myrow[features];

    $features = explode('|',$specs); //What the feild is delimited by '|'
    reset ($features);

      while (list(, $feature) = each ($features)) {

   if (file_exists("features/$feature.gif")){
   echo "<img src=\"features/$feature.gif\"><br>";
   echo "$feature";
   }

   } //End While


--
Regards,


YoBro
-------------------------------------------------------------
DO NOT REPLY TO THIS VIA EMAIL
PLEASE USE THE NEWSGROUP
All emails sent to this address are automatically deleted.
This is to avoid SPAM!
-------------------------------------------------------------



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to