implode PHP multidimensional Array into string
Code :
public function ImplodePHPArray( $Char, $ArrayVal )
{
foreach( $ArrayVal as $Row )
{
if( is_array( $Row ) )
{
$FinalArray[] = $this -> ImplodePHPArray( $Char, $Row );
}
else
{
$FinalArray[] = $Row;
}
}
return implode( $Char, $FinalArray );
}
TESTING :
$Week = $ClassObj -> ImplodePHPArray('~^', $Week);
echo $Week;
No comments:
Post a Comment