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.
21 lines
539 B
21 lines
539 B
<?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]; |
|
} |
|
}
|
|
|