Jump to content

mojobadshah

New Members
  • Posts

    1
  • Joined

  • Last visited

mojobadshah's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I would like to be able to use a succession of php preg_match() and preg_replace() functions in one script without having to produce clutter in this match and replace php coding script and without its results showing arrayed forms. The following is a RegExp formula that I'm comfortable with that involves only a replace function. I'm curious what the best way would be to scoot a RegExp match function into a script like this one that is consistent with the same $current .= preg_replace('/a/', 'b', $current); php code that I've shown here et. al. that can be written out on one string. I've seen some php implode() functions, but my concern is that an additional function as such along with preg_mach() functions will cause a lot of deviation in a list of regular regex match and replace functions. What can I do to keep both php match and replace RegExp functions strings typed out in linear concession for the sake of keeping things organized when strictly relating to regex functions and working with them within php and working something like an implode() function into my php script so that match and replace functions can produced organized results outside of having to make use of arrays? <?php $file = 'sample.txt'; $current = file_get_contents($file); $current .= preg_replace('/a/', 'b', $current); file_put_contents($file, $current); ?>
×
×
  • 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.