问题描述:

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);
网友答案:

$partTwo = substr($contactnumber,5);

相关阅读:
Top