Created
August 17, 2018 14:51
-
-
Save peledies/6ffac49ddd1946b9daee4260e1438266 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function parseVariables( $path ) | |
{ | |
$wpConfig = file_get_contents( $path ); | |
preg_match_all("/[^#]define\('(.*?)',\s*'(.*)'\);/", $wpConfig, $matches); | |
for($c=0;$c<count($matches[1]);$c++) { | |
$values[$matches[1][$c]] = $matches[2][$c]; | |
} | |
return $values; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment