I have a string which contain contact numbers. For example,
$contactnumber='923216210221'
Now I want to separate starting 5 digits e.g. '92321' in a different variable and other digit e.g. '6210221' in a different variable.
I have a string which contain contact numbers. For example,
$contactnumber='923216210221'
Now I want to separate starting 5 digits e.g. '92321' in a different variable and other digit e.g. '6210221' in a different variable.
Use substr PHP:
$partOne = substr($contactnumber, 0, 5);
$partTwo = substr($contactnumber, 6);