【发布时间】:2015-12-02 11:14:59
【问题描述】:
我有一个这样的字符串 |casio|watch|men|在一个 xml 中。我想爆炸这个,我需要这样的输出: $brand = "casio"; $cat = "手表";.
我使用了这些代码,但它没有帮助我
<?php
$string = '|casio|watch|men|';
$string = explode('-',$string);
var_dump($string);
echo $string[0];
echo $string[1];
?>
【问题讨论】:
-
看来你想要
explode('|', $string); -
是的,这是一个错误并且有效! ty