How could I Explode
Posted: Fri Aug 18, 2006 9:31 am
I have this string :
I want to explode it to an array :
I want to put each string between [am][/am] Tag in array.
like [ php ] tage in this forum.
What's the wrong with my code ??
Code: Select all
$str ="[am]cgbxgb[/am]
[am]zdgdgd2[/am]
[am]dhgsfdh3[/am]";Code: Select all
$t ="[am]cgbxgb[/am]
[am]zdgdgd2[/am]
[am]dhgsfdh3[/am]";
$str = Explode( '[am]', $t );
if ( count($str) > 1 )
{
foreach ( $str AS $strX )
{
$str2 = Explode( '[/am]', $strX[1] );
$d['a'][] = Array( $str2[0], 0 );
}
}like [ php ] tage in this forum.
What's the wrong with my code ??
