⊗ppPmSFVO 287 of 447 menu

Inserting a PHP Variable into HTML Code

Suppose now we have a paragraph, above which a PHP variable is defined:

<?php $str = 'text'; ?> <p>text</p>

We can insert our variable inside the paragraph:

<?php $str = 'text'; ?> <p><?php echo $str; ?></p>

Or we can simplify the variable insertion using a short PHP tag:

<?php $str = 'text'; ?> <p><?= $str ?></p>

Three variables are given:

<?php $str1 = 'text1'; $str2 = 'text2'; $str3 = 'text3'; ?>

Also, three paragraphs are given:

<p></p> <p></p> <p></p>

Insert the text of the variables into the corresponding paragraphs.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline