簡體   English   中英

我正在嘗試將 HTML 添加到 PHP 數組中

[英]I'm trying to add HTML into a PHP array

它不像我在其他地方看到的所有其他示例那樣的表單,而是我用來根據用戶單擊的內容將內容動態加載到單個網頁的大型數組。 我想將一些項目鏈接到某些網站。

$cosmeticServices = array(
    injections => array(
        "title" => "Toxin Injections",
        "picture" => "img here",
        "content" => "Toxin injection solutions include:"?><a href="google.com">&reg;Botox,</a><?php"&reg;Xeomin, &reg;Juveau, &reg;Dysport"
    ),

數組中有更多的項目,這就是括號后有逗號的原因。 我已經嘗試使用單引號、雙引號、更改引號的位置以及不退出 PHP,只需在 php 字符串中包含 HTML 即可。 這是我最新的嘗試,退出 PHP 並插入 HTML,但根本不起作用。 很多錯誤消息來自它。

我認為你的意思是逃避雙引號

"content" => "Toxin injection solutions include: <a href=\"https://botox.com\">&reg;Botox,</a>&reg;Xeomin, &reg;Juveau, &reg;Dysport"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM