Convert string to Array in PHP

How to Convert string to Array in PHP ?

To convert String to array in php explode function is use.


Syntax :explode(\'delimiter\',string);

For Example

<?php
$a =\"Learn PHP\" // then using explode function we can write 
$a =\"Learn PHP\";
$b=\" \";/////$b is delimiterhaving value white space 
$c=explode ($b ,$a); ///the output will be $c array having two element Learn and PHP  
 ?> 

 

Scroll to Top