[英]I'm trying to add HTML into a PHP array
It's not a form like all of the other examples I've seen elsewhere, but rather a large array that I use to dynamically load content to a single webpage depending on what the user clicks.它不像我在其他地方看到的所有其他示例那样的表单,而是我用来根据用户单击的内容将内容动态加载到单个网页的大型数组。 I would like to link some of the items to certain websites.我想将一些项目链接到某些网站。
$cosmeticServices = array(
injections => array(
"title" => "Toxin Injections",
"picture" => "img here",
"content" => "Toxin injection solutions include:"?><a href="google.com">®Botox,</a><?php"®Xeomin, ®Juveau, ®Dysport"
),
There are more items in the array, which is why there's a comma after the parenthesis.数组中有更多的项目,这就是括号后有逗号的原因。 I've tried it with single quotes, double quotes, changing the location of the quotes, and not exiting PHP by just including HTML in the php string.我已经尝试使用单引号、双引号、更改引号的位置以及不退出 PHP,只需在 php 字符串中包含 HTML 即可。 This is my latest attempt to do it by exiting out of the PHP and inserting HTML, but not at all working.这是我最新的尝试,退出 PHP 并插入 HTML,但根本不起作用。 Lots of error messages coming from it.很多错误消息来自它。
I would think you meant to just escape the double quotes我认为你的意思是逃避双引号
"content" => "Toxin injection solutions include: <a href=\"https://botox.com\">®Botox,</a>®Xeomin, ®Juveau, ®Dysport"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.