I wanted to validate a string with preg_match but after a lot of struggle I just used if($str[0]!='x'....
but just out of curiosity I wonna know how to do this using preg_match
I'm getting a string as an input-
the 1st char in the string must be %
the 2nd char must be space
the 3rd char must be a number
and the rest can be anything (special chars/numbers/letters..)
arcticM
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.