'标题',   'meta_keywords' => 关键字'',   'meta_description' => '描述',   'copyright' => '"/> '标题',   'meta_keywords' => 关键字'',   'meta_description' => '描述',   'copyright' => '">
Home > Backend Development > PHP Tutorial > eval函数使用有关问题

eval函数使用有关问题

WBOY
Release: 2016-06-13 10:14:26
Original
884 people have browsed it

eval函数使用问题
$page_info="array (
  'meta_title' => '标题',
  'meta_keywords' => 关键字'',
  'meta_description' => '描述',
  'copyright' => '
版权',
  'banner' => 'banner
',
  'top' => '',
)
";
我现在要让$page_info等于这个数组,请问如何操作,试了好久不知道是不是数组里符号转义问题,老是不成功。


我写的eval("\$info = $page_info;");
好像不对,不知道怎么回事

------解决方案--------------------

PHP code
$page_info="array (  'meta_title' => '标题',  'meta_keywords' => '关键字',  'meta_description' => '描述',  'copyright' => '<br>版权',  'banner' => 'banner<br>',  'top' => '',)";eval("\$page_info = $page_info;");或$page_info = eval("return $page_info;");<div class="clear">
                 
              
              
        
            </div>
Copy after login
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