ramki067
05-29-2008, 05:01 AM
Hi,
I've two preg_match in the for loop and i've select one based on the input. But i'm getting it wrong. Please help.
1. preg_match('/0x[0-9a-z]/i',$value)
2. preg_match ('/\d+x\d./i/', $value)
The first preg_match SHOULD match inputs having 0x at the starting followed by any alphabets or digits. For ex: 0x11, 0x33.
The second preg_match SHOULD have digits at the start followed by "x"(Letter x) and followed by digits with characters.For ex: 800x600,1920x1080i.
But whatever input i give it takes the first preg_match itself. Please clarify.I'm using these two preg_matches in foreach loop.
Thanks,
ramki.
I've two preg_match in the for loop and i've select one based on the input. But i'm getting it wrong. Please help.
1. preg_match('/0x[0-9a-z]/i',$value)
2. preg_match ('/\d+x\d./i/', $value)
The first preg_match SHOULD match inputs having 0x at the starting followed by any alphabets or digits. For ex: 0x11, 0x33.
The second preg_match SHOULD have digits at the start followed by "x"(Letter x) and followed by digits with characters.For ex: 800x600,1920x1080i.
But whatever input i give it takes the first preg_match itself. Please clarify.I'm using these two preg_matches in foreach loop.
Thanks,
ramki.