PHP Snippets
Name:explode and implode example
Description: Example of php's explode and implode function.
Code below...
>
<?php
$string = "some.text.separated.here";
// "explode" the "dot" and put it in an array
$string = explode(".",$string);
// result
echo "$string[0] $string[1] $string[2] $string[3] $string[4]<br/>";
// "implode" the "dot"
$string = implode(".",$string);
// result
echo $string;
?>
$string = "some.text.separated.here";
// "explode" the "dot" and put it in an array
$string = explode(".",$string);
// result
echo "$string[0] $string[1] $string[2] $string[3] $string[4]<br/>";
// "implode" the "dot"
$string = implode(".",$string);
// result
echo $string;
?>