Jump to content

need help please


osh_php

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/55989-need-help-please/
Share on other sites

  $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

Link to comment
https://forums.phpfreaks.com/topic/55989-need-help-please/#findComment-276552
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/55989-need-help-please/#findComment-276576
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.