The following JavaScript code has the print a text function on elements with the class exibir
:
$(document).ready(function(){
$(".exibir").text("Olá Mundo!");
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><pclass="exibir">Isso é um parágrafo.</p>
<p class="exibir">Isso é um parágrafo.</p>
The code that I type "maqueia" the texts contained, I wanted to do the same, only in PHP, because I'm creating a page that needs to come printed from the server ( PHP
), instead of being changed after loaded page ( Javascript
).
How to do this same function in PHP ?
I'm creating a page that contains 4 equal texts in the body of the page.
I need somehow to set what will be displayed in these 4 texts in the page header, that is, there in the header " <head>
" I can set via PHP
, which will be displayed in these 4 identical texts that are in the body of the page " <body>
".