Re: [PHP] matches problem ("preg_match")

2001-11-14 Thread Bruno Grab
Thank you for your answer. However our real problem is to solve it with preg_match. we want to rather analyse more complicated structures than the one in our example. Well, let me reformulate it: How can we (with preg_match) s a v e each subpattern into an array element, that is, also e a c h m

Re: [PHP] matches problem ("preg_match")

2001-11-13 Thread Valentin V. Petruchek
Try this code: $str="eins zwei drei vier fünf sechs"; $Wort = explode (' ',$str); $n=count($Wort); for($i=0;$i<$n;$i++){echo "$i: $Wort[$i]";} It should works Zliy Pes [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additi

[PHP] matches problem ("preg_match")

2001-11-13 Thread Ewald Schoeller
hello we want to save every word of a text in an array field. we want to solve the problem without "split". Here's our code: $str="eins zwei drei vier fünf sechs"; preg_match("'(\w+)(\s+\w+)*'",$str,$Wort); $n=count($Wort); for($i=0;$i<$n;$i++){echo "$i: $Wort[$i]";} The result is: 0: eins zwe