在变量前添加字符
Add character before a variable
发号前需要加字符
$phone = $_POST['user_phone'];
如果 user_phone 是 123456789,我需要在发布号码之前将其转换为 0123456789。
PHP 使用 .
字符进行字符串连接。
您可以将其连接起来:
$user_phone = '123456789';
$user_phone = '0'.$user_phone;
$_POST['user_phone'] = $user_phone;
发号前需要加字符
$phone = $_POST['user_phone'];
如果 user_phone 是 123456789,我需要在发布号码之前将其转换为 0123456789。
PHP 使用 .
字符进行字符串连接。
您可以将其连接起来:
$user_phone = '123456789';
$user_phone = '0'.$user_phone;
$_POST['user_phone'] = $user_phone;