'标题',   'meta_keywords' => 关键字'',   'meta_description' => '描述',   'copyright' => '"/> '标题',   'meta_keywords' => 关键字'',   'meta_description' => '描述',   'copyright' => '">

Home  >  Article  >  Backend Development  >  eval函数使用有关问题

eval函数使用有关问题

WBOY
WBOYOriginal
2016-06-13 10:14:26857browse

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>
Statement:
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