Topic: How to convert string to array in php?
Hello Guys, How to convert string to array?
Is this should be like this?
arr[0]=this
arr[1]=is
arr[2]=string
Dear CuteNews Users! Please feel free to contact us via our new Feedback Form and please send information about bugs to our bug tracker.
You are not logged in. Please login or register.
CutePHP Forums → HTML, CSS and Overall Look → How to convert string to array in php?
Hello Guys, How to convert string to array?
Is this should be like this?
arr[0]=this
arr[1]=is
arr[2]=string
Youcan perform the conversion using PHP-function:
preg_split("~\s~", "this is string");
Is preg_split still valid in php v7+
Yes it it still valid in v7.0
Good to know, thx.
No problem :-)
Yes i agree..using preg_split command will easily covert array to a string.Cheers.
array preg_split( $pattern, $subject, $limit, $flag ) This will work fine in your problem Tellthebell.com
PHP Explode () Function Basically the PHP explode () function is used to split or break strings to substrings by a given delimiter in PHP. This returns an array of broken substrings that you can assign to arrays variable in PHP. In other words, the PHP explode () function is used to convert a string or a comma-separated string into an array mcdvoice login
CutePHP Forums → HTML, CSS and Overall Look → How to convert string to array in php?
Powered by PunBB, supported by Informer Technologies, Inc.
The pun_antispam official extension is installed. Copyright © 2003–2009 PunBB.