是否可以拆分单个列数据并将其存储在不同的变量中?
像
SELECT telephone FROM contacts WHERE id='1';
电话的价值是XXX-XXX-XXXX
$first = '(first)';
$second= '(second)';
$third= '(third)';
$dash = '(dash)';
答案 0 :(得分:0)
$telNumber = "123-345-6789";
$telArray = explode("-",$telNumber);
$first = $telArray[0]; //123
$second= $telArray[1]; //345
$third= $telArray[2]; //6789