Hi,
I'm trying to delete the empty options of a html tag, using ereg_replace.
The problem is that it's removing all the options, even those that are not empty!
Here is the code :
function necho($opt)
{
$opt=ereg_replace(" .*\"\" ", "", $opt);
echo "$opt";
}
necho("<body bgcolor=\"green\" background=\"\" text=\"\" link=\"red\" vlink=\"\" alink=\"red\" leftmargin=\"\" topmargin=\"\" >");
It should return :
"<body bgcolor="green" link="red" alink="red">"
But only write :
"<body>"
Could someone help? Thanks.