Results 1 to 4 of 4
Threaded View
-
24th Sep 2012, 11:08 AM #1OPMember
Preg_replace help
Im scanning 1000's of files and want to replace certain values to 0
The values here 750,15 need to be changed to 0 and pushshort changed to pushbyte.
pushshort could be between 1-10,000
time could be between 1-10,000
The whole code needs to be matched so it doesnt edit the wrong sections in files.
PHP Code:pushstring "costs"
pushstring "r1"
pushshort 750
pushstring "r2"
pushbyte 0
pushstring "r3"
pushbyte 0
pushstring "r4"
pushbyte 0
pushstring "time"
pushbyte 15
And any number in this set to 0, and pushshort changed to pushbyte.
PHP Code:pushstring "repairTime"
pushbyte 30
pushbyte 60
pushbyte 120
pushshort 240
pushshort 480
pushshort 960
pushshort 1920
pushshort 3840
pushshort 7680
pushshort 15360
Gavo Reviewed by Gavo on . Preg_replace help Im scanning 1000's of files and want to replace certain values to 0 The values here 750,15 need to be changed to 0 and pushshort changed to pushbyte. pushshort could be between 1-10,000 time could be between 1-10,000 The whole code needs to be matched so it doesnt edit the wrong sections in files. Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Replace with Dynamic variable in preg_replace
By MarPlo in forum Web Development AreaReplies: 2Last Post: 21st Feb 2012, 08:36 AM -
Wordpress title preg_replace
By energyboost in forum WordpressReplies: 2Last Post: 3rd Oct 2011, 11:47 PM -
Lulzimg preg_replace help
By masterb56 in forum Web Development AreaReplies: 2Last Post: 15th Aug 2011, 06:31 PM -
preg_replace first half of matches ?
By Porsche_maniak in forum Web Development AreaReplies: 1Last Post: 16th Jan 2011, 05:12 PM
themaCreator - create posts from...
Version 3.45 released. Open older version (or...