I'm trying to understand where I went wrong I need to insert by replacing <DIV with <DIV ID="div0", <DIV ID="div1", <DIV ID="div2", <DIV ID="div3",...
This is what's happening so far:PHP Code:$i=0;
function divCount(){
$i = $i + 1;
$iString = $i + "";
return "div".$iString;
}
$strResult = str_replace("<DIV STYLE=", "<DIV ID='".divCount()."' STYLE=", $result);
echo $strResult;
Code:<DIV ID='div1' STYLE="POSITION:ABSOLUTE;TOP:69;LEFT:177" CLASS="APFont00000">...</DIV> <DIV ID='div1' STYLE="POSITION:ABSOLUTE;TOP:88;LEFT:290" CLASS="APFont00001">...</DIV> <DIV ID='div1' STYLE="POSITION:ABSOLUTE;TOP:103;LEFT:231" CLASS="APFont00001">...</DIV> <DIV ID='div1' STYLE="POSITION:ABSOLUTE;TOP:154;LEFT:71" CLASS="APFont00002">...</DIV>




Reply With Quote