How to echo or print an array in PHP?

前端 未结 11 1445
春和景丽
春和景丽 2020-11-22 17:18

I have this array

Array
(
  [data] => Array
    (
      [0] => Array
        (
          [page_id] => 204725966262837
          [type] => WEBSITE         


        
11条回答
  •  死守一世寂寞
    2020-11-22 17:46

    I know this is an old question but if you want a parseable PHP representation you could use:

    $parseablePhpCode = var_export($yourVariable,true);
    

    If you echo the exported code to a file.php (with a return statement) you may require it as

    $yourVariable = require('file.php');
    

提交回复
热议问题