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;

?>

« Back to PHP Snippets

Home | Site Map | Privacy Policy | Advertising | Contact Us
Copyright © 2006-2014 r2xDesign.net - All Rights Reserved.
eXTReMe Tracker