Results 1 to 10 of 11
Hybrid View
-
25th Sep 2010, 03:51 PM #1MemberWebsite's:
Pirateview.org Gfxs.org StarkWood.orgdude, you donot need to edit the file manually, when adding a variable in the regEx, it will automatically be updated.
NucleA Reviewed by NucleA on . replace a specific line in a php file Hi. I'm just a noob in php. I need to know how I can replace a specific line of text in a php file. For example, in a php file below named conf.php, I want 'used_dir' => 'files/',, which is in the third line, to be replaced with 'used_dir' => 'new_files/',. How can i do this? Any reply will be appreciated. <?php $options = array ( 'used_dir' => 'files/', 'login' => true, ); ?> PS: I was thinking I can apply file_get_contents() and file_put_contents() functions in this but I don't Rating: 5
-
25th Sep 2010, 03:59 PM #2Member
change the config like that and define $new when you want to use dir new_files ?
PHP Code:<?php
if ($new==1) {
$options = array (
'used_dir' => 'new_files/',
'login' => true,
);
}
else
{
$options = array (
'used_dir' => 'files/',
'login' => true,
);
}
?>
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Delete specific file in each folder
By Ruriko in forum Technical Help Desk SupportReplies: 6Last Post: 6th Oct 2012, 01:05 AM -
[Blogger] Code to live replace specific words
By nICEsHARE in forum Web Application/Script SupportReplies: 0Last Post: 2nd Aug 2011, 01:01 PM -
Debian - command line. Replace () in filenames with _
By AndroidApps in forum Web Development AreaReplies: 2Last Post: 9th Jul 2010, 09:30 AM -
Specific File Hosts Sites
By DeLeTeD in forum Forum and DDL DiscussionReplies: 13Last Post: 5th Apr 2010, 10:10 PM
themaCreator - create posts from...
Version 3.53 released. Open older version (or...