-3
The following Javascript code has the function of print a text in the 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>
<p class="exibir">Isso é um parágrafo.</p>
<p class="exibir">Isso é um parágrafo.</p>
The code I mentioned type "maqueia" the texts contained, wanted to do the same, only in PHP, because I am creating a page that needs to be printed already from the server (PHP
), instead of being changed after loading the page (Javascript
).
How to do this same function in PHP ?
I am creating a page that contains 4 identical texts in the body of the page.
I need to somehow set what will be displayed in these 4 texts in the page header, IE, there in the header "<head>
" I can define via PHP
, what will be displayed in these 4 identical texts that are in the body of the page "<body>
".
Use a DOM interpreter is an option?
– rdleal
Any answer that might solve the problem is always welcome :)
– Alexandre Lopes
I cannot answer your question, as it is pending. Your Javascript example gives us an idea of what you want to do, but it would help clarify exactly what you want to do if you put some example of what you tried to do in PHP.
– rdleal
@Panther Give a vote there to reopen :P, worse than I tried to do in
PHP
, because I’m new to PHP.– Alexandre Lopes