Where do i wrong?

Status
Not open for further replies.

Porsche_maniak

Active Member
283
2009
0
40
Code:
$value=str_replace($unwanted, $wanted, $value);
$unwanted = array("[img]", "[/img]");
$wanted  = array("[img=", " width=200]");

When i use the above code,nothing happens.
 
6 comments
aren't they declared ?

$unwanted = array("
");
$wanted = array("[img=", " width=200]");
 
Code:
$unwanted = array("[img]", "[/img]");
$wanted  = array("[img=", " width=200]");
$value=str_replace($unwanted, $wanted, $value);

i think he meant this
 
PHP:
<?
$value = '[img]http://google.com[/img]';
$unwanted = array("[img]", "[/img]");
$wanted  = array("[img=", " width=200]");
$value=str_replace($unwanted, $wanted, $value);
echo $value;
?>
 
Status
Not open for further replies.
Back
Top