Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define('DT', '2017-02-01 17:25:43');
- $self = file_get_contents(__FILE__);
- $date = date('Y-m-d H:i:s');
- echo "Current date: " . DT . ", updating to {$date}\n";
- $self = preg_replace('/define\(\'DT\', \'.*?\'\)/', 'define(\'DT\', \'' . $date . '\')', $self);
- #echo $self;
- file_put_contents(__FILE__, $self);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement