3C科技 娛樂遊戲 美食旅遊 時尚美妝 親子育兒 生活休閒 金融理財 健康運動 寰宇綜合

Zi 字媒體

2017-07-25T20:27:27+00:00
加入好友
PHP 可以透過 serialize() 將物件轉換成序列化文字資料後儲存在任何地方,需要使用的時候再透過 unserialize() 進行反序列化後得到原始物件,但因為序列化資料會記錄資料長度,因此如果想直接修改序列化資料的內容,需要連同資料長度也一起算進去,手動修改時麻煩且容易出錯。這時候可以透過 Serialized PHP Editor  這個 PHP 序列化資料線上編輯器進行修改就會方便很多。   Serialized PHP Editor 連結:http://sciactive.com/phpserialeditor.php   如下圖,介面上可以看到有四大區塊,把序列化資料貼在第一個區塊後就可以開始在第二區塊進行編輯,介面提供 YAML 與 JSON 兩種編輯語法,可以在畫面左上角進行切換。而新舊差異也會即時在右下角顯示(綠色為新增,紅色為刪減)。編輯完成後即可複製右上角區塊編輯後的序列化資料做使用。   另外,作者也公開了原始碼在 Github  上,直接下載放在 HTTP Server 目錄下執行即可。 Shell # /var/www/html 是 Apache 預設的文件根目錄,請根據自身環境去修改路徑 wget https://raw.githubusercontent.com/sciactive/2be-extras/master/phpserialeditor.php -O /var/www/html/phpserialeditor.php 1 2 # /var/www/html 是 Apache 預設的文件根目錄,請根據自身環境去修改路徑 wget https://raw.githubusercontent.com/sciactive/2be-extras/master/phpserialeditor.php -O /var/www/html/phpserialeditor.php   也可以用 PHP Built-In Server 在本機上執行(複製以下指令後,以瀏覽器打開 localhost:9000) mkdir -p /var/tmp/phpserialeditor wget https://raw.githubusercontent.com/sciactive/2be-extras/master/phpserialeditor.php -O /var/tmp/phpserialeditor/index.php php -S localhost:9000 -t /var/tmp/phpserialeditor 1 2 3 mkdir -p /var/tmp/phpserialeditor wget https://raw.githubusercontent.com/sciactive/2be-extras/master/phpserialeditor.php -O /var/tmp/phpserialeditor/index.php php -S localhost:9000 -t /var/tmp/phpserialeditor References: Serialized PHP Editor sciactive/2be-extras: Various scripts, utilities, and documentation for 2be. 分享這篇文章 按一下以分享至 Facebook(在新視窗中開啟) 按一下以分享到 Google+(在新視窗中開啟) 分享到 Twitter(在新視窗中開啟) 分享到 LinkedIn(在新視窗中開啟) 分享到 Reddit(在新視窗中開啟) 分享到 Pocket(在新視窗中開啟)

本文由caloskaoorg提供 原文連結

寫了 5860316篇文章,獲得 23313次喜歡
精彩推薦