Trying to just keep the file name and remove all other characters.
require_once($GLOBALS['root'] . '/library/test/TestFactory.php');
Want it to look like this:
/library/test/TestFactory.php
So far have this
$string = "require_once($GLOBALS['root'] . '/library/test/TestFactory.php');"
$string = preg_replace("~^.*?(?=\/)~i", "", $string);
I get this but just missing the end characters of "');" Any help would be appreciated.
/library/test/TestFactory.php');
UPDATE, on another instance i get something like this but my regex won't read it well as it don't have a / in there.
require_once($_SERVER['DOCUMENT_ROOT'] . $this->config . 'display.php
I would think i would want just display.php