posts - 88, comments - 3, trackbacks - 0, articles - 0
            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

          Use PHP var_export API to dump data to file

          Posted on 2012-04-10 10:54 Milo的海域 閱讀(381) 評(píng)論(0)  編輯  收藏 所屬分類: PHP
          Some time we may not want export complex hash to console but file, we can do like this to dump to file by var_export
          <?php

          $a = array('abc'=>"123");

          # var dump
          var_dump($a);

          # var_export
          echo var_export($a);

          # export to file
          $b = var_export($a, true);
          error_log($b."\n", 3, "/tmp/ymiao.log");  

          Result:
          cat /tmp/ymiao.log
          array (
            'abc' 
          => '123',
          )


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 郎溪县| 米林县| 闸北区| 吴江市| 盘山县| 神木县| 逊克县| 犍为县| 平安县| 图们市| 区。| 宣恩县| 遵义市| 阜新| 武川县| 海伦市| 锡林郭勒盟| 玛多县| 嘉义市| 苗栗市| 马龙县| 凌云县| 莲花县| 阿克陶县| 西畴县| 余干县| 玛沁县| 年辖:市辖区| 新津县| 丰镇市| 白朗县| 宿迁市| 凯里市| 密云县| 钟山县| 新龙县| 疏附县| 调兵山市| 中牟县| 湖南省| 西充县|