<?php
$env_lines = file(getcwd() . '/.htaccess');
foreach ($env_lines as $env_line) {
if (preg_match('/^SetEnv\ /', $env_line)) {
$envs = explode(' ',$env_line);
$server = $env = '';
$server = str_replace("\n", "", $envs[1]);
if (isset($envs[2])) {
$env = $envs[2];
$env = str_replace("\"", "", $env);
$env = str_replace("\n", "", $env);
}
$_SERVER[$server] = $env;
}
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
55