Wednesday, December 10, 2008

php explode and implode

Use of Explode and implode functions

Explode - splits a string by a string
eg:
$a = explode("/","23/02/2008");
then
$a[0] = "23"
$a[1] = "02"
$a[2] = "2008"

Implode - joins array elements into string with a string

$b = implode("-",$a);
then
$b = "23-02-2008"


http://in.php.net/manual/en/function.explode.php
http://in.php.net/manual/en/function.implode.php

No comments: