Wednesday, 20 April 2016

PHP String Explode and Implode - HEMANT VISHWAKARMA

PHP Explode

Example

$myString = "I am a long and redundant sentence that serves no purpose except to be an example.";

print_r(explode(" ",$myString));



PHP Implode

Example

$myString = "I am a long and redundant sentence that serves no purpose except to be an example.";

$newArray = explode(" ",$myString);

echo implode(" ",$newArray);

No comments:

Post a Comment