Reputation: 13
How to i replace '[' charachter to span class = "someclass" .I wrote this code but it gives me only text
$replaced = str_replace(
array('[', ']'),
array("<span class"."='innovation_color innovation_color-services".">","</"."span".">"),
$string
);
Upvotes: 0
Views: 144
Reputation: 4412
you are missing some quotes :
$replaced = str_replace(
['[', ']'],
["<span class"."='innovation_color innovation_color-services'".">","</"."span".">",
$string
);
Upvotes: 1