View Single Post
Old 05-27-2009, 04:32 PM  
DigitalPimp
Confirmed User
 
Industry Role:
Join Date: Jun 2003
Location: Los Angeles, CA
Posts: 512
Need help with PHP code

Anyone know why the following does not return desired results and how to get it to?

Code:
$string = 'a,b,c,d';

if(eregi("(a)|(adf)|(c)",$string,$matchedtext)){ 
echo $matchedtext[1]; // This returns an "a" which I want
echo $matchedtext[2]; // This is empty, I want it to return a "c"
}
DigitalPimp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote