Re: Re: preg_split problem

From: Date: Sat, 09 Nov 2002 18:13:19 +0000
Subject: Re: Re: preg_split problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-123604@lists.php.net to get a copy of this message
At 18:59 09.11.2002, samug said: --------------------[snip]-------------------- >Thanks. >But what if you don't know how many elements there will be ahead? > >"Samug" <samug@vectorstar.net> kirjoitti viestissä >news:20021109165530.58233.qmail@pb1.pair.com... >> Could someone tell me why isn't this working? >> >> $text = "And what did I tell you?"; >> list($one,$two,$three,$rest) = preg_split("/\s+/", $text); >> print($rest); --------------------[snip]-------------------- You don't need the number of elements _ahead_, just the number of elements you want to receive - the "rest" will be in the last element. -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/

« previous php.general (#123604) next »