The problem that PHP's putenv function cannot be used in Chinese

WBOY
Release: 2016-10-10 11:39:14
Original
2114 people have browsed it

If you know laravel, you can take a look at the above section; if you don’t, just go straight below the dividing line;

Any item in .env, here is MAIL_DRIVER as an example
Change it to "my" and use the env function, and you can get the value normally;
Change it to "I" and use the env function, and you can't get it normally;

<code>MAIL_DRIVER=我
var_dump(env(MAIL_DRIVER''));  // NULL


MAIL_DRIVER=我的
var_dump(env(MAIL_DRIVER''));  // 我的</code>
Copy after login

This situation will also occur with other Chinese words such as "good";
I have to say; laravel is broad and profound; I have studied the source code of the env function;
The problem I finally identified is;
--------- ----------------------------------------Understand and understand the dividing line between laravel framework- --------------------------------------------------

<code>putenv("PROJECT_NAME=我的");
phpinfo();</code>
Copy after login

You can search for PROJECT_NAME in Environment in phpinfo

<code>putenv("PROJECT_NAME=我");
phpinfo();</code>
Copy after login

Project_NAME cannot be found in Environment in phpinfo

Dear friends, why is this? How to set Chinese value without any problem?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template