我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

序列化对象输出奇怪的符号

<?php
class test {
  private $a;
}

$test = new test;
$test = serialize($test);
echo "<a href=$test>$test</a>";

A string from the resulting markup:

<a href="O:4:&quot;test&quot;:1:{s:7:&quot;�test�a&quot;;N;}">O:4:"test":1:{s:7:"testa";N;}</a>

Question: why the value of the same variable output as a value of href attribute is seen WITH these � symbols while placed as content of the anchor tag is seen WITHOUT these � symbols?

近期文章

  • CodeIgniter动态钩子
  • 如何向页面提交多个表单
  • Wordpress - 只能找到主页
  • WooCommerce - 隐藏产品图片(如果没有)
  • 如何回滚已更改的列
  • 来自rest api的curl响应 - 删除标题[PHP]
  • 在XAMPP / CentOS 7上安装php-mssql
  • 消除文本框之间的空格
  • PDO :: exec异常处理出错
  • 如何使用gd php合并两个图像
  • 使用PHP-curl:安全标头无效
  • 使用Ajax的父子Selectbox Wordpress
  • 检查文件是否存在/附加带名称的号码
  • Datalist搜索innerHTML而不是值?
  • Wordpress数组不能按标题过滤
  • 将特定的php请求重定向到非php url
  • Wordpress全局变量,我可以在管理面板中编辑
  • Telegram bot:将全文显示为ReplyKeyboardMarkup按钮
  • 从多个表中创建PHP和Mysql中的动态链接
  • 模型保存在yii中不起作用,并且它没有重定向到查看页面

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华