test";"."/> test";".">

Home  >  Article  >  Backend Development  >  How to add hyperlink in php language

How to add hyperlink in php language

藏色散人
藏色散人Original
2019-10-10 10:00:375591browse

How to add hyperlink in php language

How to add hyperlinks in php language?

There are several ways to write HTML code (including hyperlinks) in PHP programming.

First, write directly, but write it outside the PHP code block.

For example:

<a href=&#39;xxx&#39;>test</a>

Second, use echo to output directly in the PHP code.

For example:

echo "<a href=&#39;xxx&#39;>test</a>";

Third, use the latest function of PHP5 "new string" to output.

For example:

$str=mark<<<
<a href=&#39;xxx&#39;>test</a>
mark;
echo $str;

All html codes or other strings between mark<<< and mark; can be written freely. These will be assigned to the $str variable and finally output. The $str variable is enough, and mark is like a pre-formatted tag in HTML. This is also the power of PHP. It is very considerate to programmers, knows what programmers need, and knows how to make programming more convenient and faster for programmers.

For more PHP related knowledge, please visit PHP Chinese website!

The above is the detailed content of How to add hyperlink in php language. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn