You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
539 B
22 lines
539 B
3 years ago
|
<?php
|
||
|
|
||
|
function UpdateConfigValue($strContent, $key, $value)
|
||
|
{
|
||
|
$status = preg_match("/define\(\"*'*$key'*\"*\s*,\s*'*(.*?)'*\)/", $strContent, $result);
|
||
|
if ($status == 0) {
|
||
|
return false;
|
||
|
} else {
|
||
|
return str_replace($result[0], "define('$key', '$value')", $strContent);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function GetConfigValue($strContent, $key)
|
||
|
{
|
||
|
$status = preg_match("/define\(\"*'*$key'*\"*\s*,\s*'*(.*?)'*\)/", $strContent, $result);
|
||
|
if ($status == 0) {
|
||
|
return false;
|
||
|
} else {
|
||
|
return $result[1];
|
||
|
}
|
||
|
}
|