开发者

php string problem

开发者 https://www.devze.com 2023-02-23 05:38 出处:网络
hi i have a string containting values i.e. Acton $ 80 Ajax $ 80 Aldershot $ 80 Alliston $ 115 Alton $开发者_如何学编程 80 Aldershot $ 84 Alexandria $ 674

hi i have a string containting values i.e. Acton $ 80 Ajax $ 80 Aldershot $ 80 Alliston $ 115 Alton $开发者_如何学编程 80 Aldershot $ 84 Alexandria $ 674

i want to make Acton Ajax so on.

please help


try this

 explode(" ",$urStringVar)

explode will return array

good luck


$prices = explode(' ', '$34 $67 ...');


You can also use:

$myarray = str_split($mystring);

this would split your string into an array. Optionally you can specify the length of each element of the array, for example:

$myarray = str_split($mystring,3);

this would divide the string in chunks of 3 characters.

0

精彩评论

暂无评论...
验证码 换一张
取 消