Converting strings to arrays with PHP

time:05-01-01 forum:PHP tools and code
  The article reloaded from the http://www.111cn.net/phper/php/35651.htm

php string array provides three PHP string to array methods, using the function explode str_split split Eval and other functions to give different examples of how to convert the string into an array instance. The

php tutorial string
article provides three PHP string to array methods, using the function explode str_split split Eval and other four functions to give different examples of how to convert a string into an array instance.
*/

$str =.Quot; corn, broccoli, zucchini.quot;
$ar = explode (.Quot; > > >); definition and usage of definitions and usage.

syntax
explode (separator, string, limit) parameters describe
separator necessary. Specify where a string is split.
string is necessary. A string to be split.
limit is optional. The maximum number of array elements that are required to return.
* /

$biuuu ='www.111cn.net';
print_r (str_split ($biuuu))
/*
defines and uses the
function () function to split the string into the array.

syntax
str_split (string, length) parameter describes
string necessary. A string that specifies to be split.
length is optional. The length of each array element is specified. The default is 1.
*/

//
$str=.quot; $str=$str;.Quot;
Eval ($str);

coffee. The function of the Val () function is to return the string corresponding to the PHP code.


$str=.quot; 1:0:1:0:1.quot;
$arraylist=split (.Quot;.Quot; $str); / / / / /

prev:PHP removes the last character substr ()... next:"The two generation of agriculture" marr...
post comment
Notice



approved   Collection£¡ Bitten by cats and dogs...   May 3rd is the 90th anniversary city...   [craftsman road] a legendary brother...   May 1 go to these scenic spots to pl...   Do not work to go to school and not ...
rand   Regular string replacement and parti...   PHP determines the character functio...   Put URL shortcuts on the PHP code on...   Cross domain call COOKIES   Implementation of escape decoding fu...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com