Results 11 to 11 of 11
Threaded View
-
25th Sep 2010, 12:59 PM #1OPBanned
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 Code:<?php
$options = array (
'used_dir' => 'files/',
'login' => true,
);
?>techdaemon Reviewed by techdaemon 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
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.51 released. Open older version (or...