echo"This works: {$arr['foo'][3]}";
echo"This works too: {$obj->values[3]->name}";
echo"This is the value of the var named $name: {${$name}}";
echo"value of the var named by the return value of getName(): {${getName()}}";
echo"value of the var named by the return value of \$object->getName(): {${$object->getName()}}";解析数组
$juices = array("apple", "orange", "koolaid1" => "purple");
echo"He drank some $juices[0] juice.".PHP_EOL;
echo"He drank some $juices[koolaid1] juice.".PHP_EOL;
// 有效,只有通过花括号语法才能正确解析带引号的键名
echo"This works: {$arr['key']}";
// 有效
echo"This works: {$arr[4][3]}";解析变量
echo"This is {$great}";
echo"This is ${great}";
输出字符串
$a = 'aaaa'; $c['c'] = "ccc"; $b = "i am '$a' and '$c[c]' \" 我是双引号!\""; echo$b; //i am 'aaaa' and 'ccc'" 我是双引号!"
{}的解析
机械设备钢材建材网站是基是一个以PHP+MySQL/Sqlite进行开发的四网合一网站源码。 系统功能特点: 四网合一企业网站管理系统支持在线升级(支持跨版本)、插件在线安装、系统内置严格的过滤体系、可以有效应对安全检测报告。 四网合一:电脑网站、手机站(数据同步、支持绑定域名)、小程序、公众号管理一个后台即可搞定。 双数据库引擎、运行环境全面:同时支持Sqlite
立即学习“PHP免费学习笔记(深入)”;
classbeers {const softdrink = 'rootbeer';
publicstatic$ale = 'ipa';
}
$rootbeer = 'A & W';
$ipa = 'Alexander Keith\'s';
// 有效,输出: I'd like an A & Wecho"I'd like an {${beers::softdrink}}\n";
// 也有效,输出: I'd like an Alexander Keith'secho"I'd like an {${beers::$ale}}\n";解析对象
// 有效
echo "This square is {$square->width}00 centimeters broad.";版权声明:知识取之于民,用之于民!欢迎转载,转载请开头附上本文链接,不定期更新文章!
以上就介绍了php 双引号里面的解析,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。










