RE: [PHP-DB] Control Structure Error

From: Date: Mon, 09 Jul 2001 01:05:08 +0000
Subject: RE: [PHP-DB] Control Structure Error
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-10165@lists.php.net to get a copy of this message
It works for me... except that you need a semi-colon after 'return $returned_string' and it sticks the word OR at the end of the whole string, which you may not want. Does that help, or did I miss the point? Ben -----Original Message----- From: Brad Lipovsky [mailto:syzme@home.com] Sent: Sunday, July 08, 2001 5:52 PM To: php-db@lists.php.net Subject: [PHP-DB] Control Structure Error Here is the code that I am trying to use: //code start function search_terms($title) { $array = explode (" ", $title); for($i=0,$n=count($array); $i<$n; $i++) { $returned_string = $returned_string . $array[$i] . " OR "; } return $returned_string } //code end I want it to turn the string of words stored in $title into an array ($array), then use the for structure to insert the string " OR " in between each word, and then finally return the string ($returned_string) for DB purposes. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#10165) next »