有关使用PHP和定界符爆炸的问题
如果我使用爆炸件,并且可以用不同的deimiters扫描字符串,则问题是确认定界符是否确实存在,我尝试解释这一点
如果我有:
$ scan =“ test”;
并将其放置:
$ exp =爆炸(“。”,$ scan);
结果总是相同的结果:
print $ exp [0];
给我:
测试
我的问题,我可以如何显示结果 test 如果真的没有定界符,这就是我的测量许多情况我有没有定界符的字符串,但是使用爆炸,并且像我一样,如果不存在在字符串内部不存在,但我认为如果在字符串中使用firt value中的界限,我会看到结果相同[0]。
最好的问候
If i use explode and i can scan string with different deimiters, the problem it´s verificate if delimiter really exists, i try to explain at this point
If i have this :
$scan="test";
And put this :
$exp=explode(".",$scan);
The result always if do this it´s the same :
print $exp[0];
Give me :
test
My question it´s how i can, don´t show the result test if really no have delimiter inside string, this it´s myquestion, because in many cases i have string with no delimiter but use explode and like me don´t show nothing if delimiter don´t exists relly inside string, but i see the result show the same if in the string don´t use delimiter in the firt value [0].
Best Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以检查爆炸的结果是否超过1个元素:
you can check the result of explode if the array count is more than 1 element: