[英]Insert array value on string php
I'm getting an error trying to make this我在尝试执行此操作时遇到错误
$array = array("text");
echo "text $array['0']";
it's possible to make it shis way instead concatenate有可能让它以 shis 的方式而不是连接
echo "text ".$array['0'];
1. You need to remove '
around 0
1.您需要删除'
大约为0
echo "text $array[0]";
Output:- https://eval.in/993458输出:- https://eval.in/993458
2.Or enclose array element with {}
2. 或者用{}
包围数组元素
echo "text {$array['0']}";
Output:- https://eval.in/993460输出:- https://eval.in/993460
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.