我在 MYSQL 表字段中有这个字符串 1111-2222-3-4-55-12345678901234567 1
。
我需要做的是用 -
分隔前 5 个参数。就像我需要分开一样:
1111
2222
3
4
55
最佳答案
$stringElements = explode('-', $string);
echo $stringElements[0];// 1111
echo $stringElements[1];// 2222
echo $stringElements[2];// 3
echo $stringElements[3];// 4
echo $stringElements[4];// 55
$stringElements[5];// 12345678901234567 1
关于mysql - 需要在 MYSQL 中用 - 分隔符分隔字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33104034/