Skip to content

Instantly share code, notes, and snippets.

@aldolat
Last active August 29, 2015 14:08
Show Gist options
  • Save aldolat/9d0bb239fdff3728fd7e to your computer and use it in GitHub Desktop.
Save aldolat/9d0bb239fdff3728fd7e to your computer and use it in GitHub Desktop.
Versione migliorata.
<?php
function toto_rename( $action ) {
switch ( $action ) :
case 'home' :
$directory = '/';
break;
case 'it' :
$directory = '/it/';
break;
case 'en' :
$directory = '/en/';
break;
endswitch;
$old_name = '/home/rlswrtub/public_html' . $directory . '.maintenance.php';
$new_name = '/home/rlswrtub/public_html' . $directory . '.maintenance';
if ( rename( $old_name, $new_name ) === TRUE) {
echo 'File rinominato';
}
}
toto_rename( 'home' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment