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
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 o
$ignored = "";
$include = "";
{
$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 question,
3 matches
Mail list logo