在PHP中爆炸()

Pau*_*ulo -1 php explode

我已经使用PHP中的explode函数将字符串分解为一个数组,给出","作为分隔符来打破字符串.我的问题是,如果字符串不包含","分隔符","该怎么办?会出现错误还是将字符串视为具有单个元素的数组?

Gle*_*rry 7

虽然它很容易测试,但我只会显示输出.

php -r 'print_r(explode(",", "this is a test"));'
Array
(
    [0] => this is a test
)
Run Code Online (Sandbox Code Playgroud)