I am looking for a pattern regular expression that is matching of first 3 character of string.
For example , I have two number like this:
011569875
and 041568956
If I found first 3 character 011
,then I will print 011569875
As suggested by @Mark, you can use substr
as follows:
$string = substr($longstring,0,3);
if($string == '011'){
echo $longstring;
}
Hope this helps. Cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With