Andy wrote:
Hi to all,
I have the following pattern for a string:
text1 /ptext2 /otext3
Does it always look like that?
text1(whitespace)/ptext2(whitespace)/otext3
Then use explode to create an array from it
explode (" ",$stringpattern);
Now, I want to extract the text by "patterns" from this string by the following rule:
no pattern -> text1 (what is before /o or /p)
/p -> text2 (what is after /p)
/o -> text3 (what is after /o)
Here you can use ereg and foreach
foreach ($stringpattern as $key => $value)
{
$variable = substr_count("/",$value);
if ($variable > 0) / has been found now extract the first two chars
}
Or something like that ~
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php