RE: [PHP] Making a string from an Array

2001-10-25 Thread Taylor, Stewart
$ignored = ; $include = ; snip { $ignored.= $words[$i]; } else { $included.= $words[$i]; -Stewart -Original Message- From: Sam [mailto:[EMAIL PROTECTED]] Sent: 25 October 2001 16:18 To: 'php' Subject: [PHP] Making a string from an Array Hi all, this may be an easy

Re: [PHP] Making a string from an Array

2001-10-25 Thread Mike Frazer
A small addition: the code below would make a string, but it would be a single word (no spaces or other word boundaries). Use this instead: $ignored .= . $words[$i]; That inserts a space before each additional word. Unfortunately it also adds a space at the beginning but you can get rid of

Re: [PHP] Making a string from an Array

2001-10-25 Thread Jim Lucas
try this out $words = explode( , $keywordText); $compare = array('on', 'the', 'in', 'at', 'is', 'it'); foreach ($words AS $value) { if (in_array($value, $compare)) { $ignored[] = $value; } else { $included[] = $value; } } Jim Lucas - Original Message -