字符串处理 [英] String handling
问题描述
你好,首先我要祝贺你们一直在做的出色工作......这个网站给了我很多很多次帮助...... :)
我是PHP的新手,几天前才开始使用这种语言,我有一个小答案,我似乎找不到满足我需求的答案......
我有一个变量,它是一个字符串,这是一组名称除以'',''我想知道是否有办法将字符串的每个名称提取为一个一系列名字或其他什么。该变量由对数据库及其类似的查询给出:
name1,name2,name3 ......哦和'',''之间的名称可以有多个单词...:S
提前感谢您的帮助,之后的cya ......
Hello there, first of all i would like to congratulate you guys for the great job you''ve been doing.. this site has helped me a lot and lots of times... :)
I''m very newbie to PHP, only started to use this language few days ago, and i have a small answer that i cant seem to find a answer to fullfill my needs...
I have a variable that is a string, which is a group of names divided by '','' and i would like to know if there is a way to extract each name of the string to an array of names or whatever. That variable is given by a query to the database and its like:
name1, name2, name3...... oh and the names between the '','' can have more then one word... :S
Thanks in advance for the help, cya later...
推荐答案
试试这个:
http://us.php.net/manual/en/function.explode.php
爆炸会分裂一个使用您作为分隔符传递的任何字符将字符串转换为数组。
try this:
http://us.php.net/manual/en/function.explode.php
explode will split a string into an array, using any character that you pass as a delimiter.
嘿,itzatez
查看这个主题。
:)
如果您需要更多帮助,请回复。
Hey, itzatez
have a look at this thread.
:)
post back if you need more assistance.
非常感谢。 ..它的工作就像一个魅力!
再次,谢谢! :)周末愉快,新年快乐......
Thanks a lot guys... it worked like a charm!
Again, thanks! :) Good weekend and happy new year...
这篇关于字符串处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!