Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.