Hello, please sign in or register
You are here: Home

Remove Unwanted Methods

This is a neat little script which will remove methods. I've written the replace string which is arguably the hardest part because you dont want to break your script do you.

 

Loop through the $arr_methods and generate the pattern match..

<?php
/**
 * Function remove the methods from the script
 */
$arr_methods = array(); // Prepopulate with methods to remove.
$script = file_get_contents( $file );

$patt = array();
foreach( $arr_methods as $str_method )
{
	$patt[] = "#\n\s*function\s+($str_method)\s*\(([^)]*)\)\s*(\{(((?:[^\{\}]|\{(?[^\}]*\})|(?3))+)?)?\})#is";
}

$script = preg_replace( $patt , "\n// Removed \\1\n", $script );

file_put_contents($file, $script);
/// Save Script

?>

 

Comments

wq123
This hilfiger outlet time swarovski jewelry something really timberland outlet strange, ...
Created 30/06/16
ninestab123
ninest123 One canada goose pas cher gucci outlet thing
Created 21/07/16
chenyingying
nike tn 2016 coach outlet online cheap nhl j...
Created 16/11/16
Title*
Comment

Prove you are not a robot

To prove you are not a robot, please type in the six character code you see in the picture below
Security confirmation codeI can't see this!
Contact
Name*
Email never shown*
Home Page

Author

Andrew Dodson
Since:Feb 2007

Comment | flag

Categories

Bookmark and Share