RE: [PHP] array_search

From: Date: Thu, 20 Nov 2003 20:01:52 +0000
Subject: RE: [PHP] array_search
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-170489@lists.php.net to get a copy of this message
On Thu, 20 Nov 2003, Jay Blanchard wrote: > $foo = $_POST['textarea']; > $newFoo = str_replace("\n", " ", $foo); > $arrayFoo = explode(" ", $newFoo); In the code above any spaces on the lines will also be delimiters... I missed that part of the requirement...? Maybe I'm not understanding the problem, but why not just use something like $myarray = preg_split('/[\r\n]+/', $textarea) ? -- Kelly Hallman //Ultrafancy/

« previous php.general (#170489) next »