Skip to content
WJunction - Webmaster Forum

Where do i wrong?

Status
Not open for further replies.
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.

About the author

Porsche_maniak
Active Member · Joined
Auto racing,Porsche,Web Development
283
Messages
0
Reactions
16
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom