Re: Character check in string

From: Date: Mon, 20 May 2002 17:08:41 +0000
Subject: Re: Character check in string
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-19287@lists.php.net to get a copy of this message
Try this: $data = "13_45"; if (stristr($data,"_")) { list($a,$b)=split("_",$data); echo $a; echo "<br>"; echo $b; } Cami ----- Original Message ----- From: "Prodoc" <abosma@hotpop.com> To: <php-db@lists.php.net> Sent: Monday, May 20, 2002 5:59 PM Subject: [PHP-DB] Character check in string > Is there a php function to check if a string contains a certain kind of > character and is there a function to split up a string? > > e.g. > I want to check if variable $data contains the character "_". > If that's the case I want to split the variable (array or seperate > variables) so I've got a variable containing "13" and one containing > "45". > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.db (#19287) next »