View Full Version : Adding a string value between tags.

01-06-2008, 02:58 PM
Trying to to add a string of text between an empty <a href></a> tag.

Tried this code, but it doesn't seem to work.
I have serached and searched the net for a solution, but I'm guessing I don't know the correct keywords for searching.

Closest I seem to have come is this code.

$string = '<img src="images/blank.gif" class="linklayer" />';
preg_replace('\/<a>([^>]*)<\/a>/is', $string);

echo $string;

As anyone knowing how to program I don't know how o handle my variables.

All that happens is that the value of string is echoed in the beginning of the document, not in between the tags i want them.

Suggestions anyone?

Thanks in advance.