osh_php Posted June 18, 2007 Share Posted June 18, 2007 im trying to convert this asp code to php using preg_replace <%tmp=GetPageNum(1166) set re = New RegExp re.global = TRUE re.Pattern="XPrintClassX" if printversion=true then tmp=re.Replace(tmp," class='hidden' ") else tmp=re.Replace(tmp,"") end if re.Pattern="XPrintWidthX" if printversion=true then tmp=re.Replace(tmp," class='tableresize' ") else tmp=re.Replace(tmp,"") end if re.Pattern="XPrintBGroundX" if printversion=true then tmp=re.Replace(tmp," class='bkground' ") else tmp=re.Replace(tmp,"") end if response.write tmp -----------when i use php converter it came like this --just small part of the program if ($printversion==true) { $tmp=preg_replace("/".$rePattern."/",($tmp $tmp=preg_replace("/".$rePattern."/", " class='hidden' ", tmp), FIXME RegExp check parameter order); //FIXME RegExp } else { $tmp=preg_replace("/".$rePattern."/",($tmp $tmp=preg_replace("/".$rePattern."/", "", tmp), FIXME RegExp check parameter order); //FIXME RegExp } CAN YOU PLEASE HELP ME TO FIX SYNTAX ERRORS OF THIS ABOVE LINES THANKS Quote Link to comment https://forums.phpfreaks.com/topic/55989-need-help-please/ Share on other sites More sharing options...
teng84 Posted June 18, 2007 Share Posted June 18, 2007 $tmp=preg_replace("/".$rePattern."/",($tmp $tmp=preg_replace("/".$rePattern."/", " class='hidden' ", tmp), FIXME RegExp check parameter order); //FIXME RegExp i think that is something wrong remember that the . should be scape and do it like this $tmp=preg_replace($rePattern.,($tmp=preg_replace($rePattern, " class='hidden' ", tmp), FIXME RegExp check parameter order); //FIXME RegExp Quote Link to comment https://forums.phpfreaks.com/topic/55989-need-help-please/#findComment-276552 Share on other sites More sharing options...
osh_php Posted June 18, 2007 Author Share Posted June 18, 2007 Do you think <?php includeWrapper::requireOnce("ILB.php"); ?> <?php includeWrapper::init(); ?> <?php if (intval(ILB::ifnill(SiteProperties::get("fg_id"),0))==intval("4")) { // TH sites are in group 4 ?> <TR><TD></td></tr></table> <TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> <TR><TD> <?php $tmp=$GetPageNum[1166]; //FIXME RegExp(); $reglobal=true; $rePattern="XPrintClassX"; if ($printversion==true) { Site::add_replacement("XPrintClassX",$tmp); //FIXME RegExp check parameter order); //FIXME RegExp } else . . . correct? do you have any idea? Quote Link to comment https://forums.phpfreaks.com/topic/55989-need-help-please/#findComment-276576 Share on other sites More sharing options...
teng84 Posted June 18, 2007 Share Posted June 18, 2007 Site::add_replacement("XPrintClassX",$tmp); this is not a php code its invalid and what are trying to do with this??? Quote Link to comment https://forums.phpfreaks.com/topic/55989-need-help-please/#findComment-276580 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.