PHP CF환경변수 얻기

1 개요[ | ]

PHP CF 환경변수 얻기
PHP
Copy
$VCAP_SERVICES = json_decode($_ENV['VCAP_SERVICES'], true);
$credentials = $VCAP_SERVICES['p-mysql'][0]['credentials'];

$DB_hostname = $credentials['hostname'];
$DB_name = $credentials['name'];
$DB_username = $credentials['username'];
$DB_password = $credentials['password'];

2 같이 보기[ | ]

3 참고[ | ]