我試圖做這樣的事情在PHP HREF:變量與鏈接結合並使其下的PHP
echo "<a href="http://www.youtube.com/watch?v=$link">watch here</a>";
我有視頻ID在$鏈接,我想將它與http://www.youtube.com/watch?v=結合並在點擊「觀看此處」時將用戶發送到該視頻。它給出了錯誤
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in xxxxxxxxxx on line xxx
我很新的PHP,請幫助。提前致謝。
您不能混合單個「用雙引號括起來,你可以在單引號中繞過鏈接或轉換引號。 –
@MihaiIorga是正確的。 它應該像echo「watch here」; – Gowri