Jump to content

Help in replacing some file content using preg_replace...


OOP

Recommended Posts

Hi there,

I am trying to create a tool to do some auto-modifications to file content. I am not an expert in regular expression and I need to ignore white space when trying to match my content.

 

For example, let say I have a file with the following code:

<?php
$i = 1;
$j = 2;

$x = $i          +            $j;

echo $x;
?>

 

Now I want to match the line $x = $i + $j; regardless of how many white space are between the variable $i,$j,and $x...is this possible?

 

 

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.