php 反序列化工具

调试代码,经常需要打印变量,今天写了一个简单的反序列化页面,存下来用的时候方便。

php 反序列化工具


<html>
<header>
<title>反序列化工具</title>

<style>
td{line-height:30px;}
</style>
</header>

<body>
<form name='thisform' action='' method="post">
<table width="100%" border="0">
<tr>
<th></th>
<th>
<article>
<h1 style='text-align:left;'>反序列化工具</h1>
<p style='text-align:left;'>请将序列化内容输入文本框:</p>
<p style='font-weight:normal;text-align:left;'>如:a:3:{s:3:"act";s:6:"refund";s:2:"op";s:4:"edit";s:9:"refund_id";s:2:"25";}</p>
</article>
</th>
</tr>

<tr>
<td></td>
<td>
<textarea rows="15" cols="100" name='abc' ><?php if (!empty($_POST['abc'])){echo $_POST['abc'];}?></textarea>
</td>
</tr>

<tr>
<td></td>
<td><button type="submit" style="width:100px;height:40px;font-size:16px;">提交</button></td>
</tr>

<tr>
<td></td>
<td style='height:60px;'>反序列化结果:</td>
</tr>

<tr>
<td></td>
<td>
<textarea rows="15" cols="100" name='tmp' ><?php if (!empty($_POST)){var_dump(unserialize($_POST['abc']));}?></textarea>
</td>
</tr>

</table>
</form>

</body>
</html>