字符串输入示例:
$var = "9999-111 Google";
$var_2 = "9999-222 StackOverflow Web";
I want to get only the postcode and then the address.
$postcode_A = explode(" ", $var);
// postcode[0] returns '9999-111' - postcode[1] returns 'Google'
$postcode_B = explode(" ", $var_2);
// postcode[0] returns '9999-222' - postcode[1] returns 'StackOverflow'
// and I want postcode[1] to return 'StackOverflow Web';
我怎样才能做到这一点?谢谢。