Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- remove a select option from loop if equals


ahmed24 - 12:21 pm on Sep 15, 2009 (gmt 0)


hi,

i have a loop which displays select options like this:

foreach($codes as $key => $val){
echo "<option value='CODE_".$codes[$key]['ID']."'>".$codes[$key]['TITLE']."</option>";
}

I also have a variable called $remove

I would like to know how i can skip a loop in my code if the $codes[$key]['TITLE'] value matches the $remove variable value ?

any ideas?

thanks

[edited by: ahmed24 at 12:50 pm (utc) on Sep. 15, 2009]


Thread source:: http://www.webmasterworld.com/php/3989666.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com