Write an array down the configuration file,& symbol Why did you become &amp

Source: Internet
Author: User
Writes an array to the configuration file,& symbol why &

$config _arr = Var_export ($configdata, true);
$config _txt = " file_put_contents (' config.ini.php ', $config _txt);


$config _arr is an array with the & symbol in the array value and writes it to config.ini.php after the,& symbol becomes &

Is there a way to keep it the same?
------to solve the idea----------------------
This is not possible, you should have done it in the first HTML escape
$a = Array (' a ' = = ' &abc ');
$s = var_export ($a, 1);
Echo $s;
Array (
' A ' = ' &abc ',
)

------to solve the idea----------------------
References:
this solves the problem of character escaping when the parameter is received.
Now there is one more question:
The ConfigData array has character backslashes \, after this sentence
$config _arr = Var_export ($configdata, true);

After writing to the configuration file, the backslash becomes \ \ How to resolve


Stripslashes () Use this method to turn back.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.