1
I have this php line:
echo '<a href="?p=ultimasnoticias&pagina='.$i.'">'.$i.'</a>';
I need to put the .$i.
between the <a>.$i.</a>
in my html script, example:
<nav>
<ul>
<li>
<a>.$i.</a>
</li>
How do I do that?
1
I have this php line:
echo '<a href="?p=ultimasnoticias&pagina='.$i.'">'.$i.'</a>';
I need to put the .$i.
between the <a>.$i.</a>
in my html script, example:
<nav>
<ul>
<li>
<a>.$i.</a>
</li>
How do I do that?
3
Easy.
<nav>
<ul>
<li>
<?php echo '<a href="?p=ultimasnoticias&pagina='.$i.'">'.$i.'</a>'; ?>
</li>
Another option would be:
<nav>
<ul>
<li>
<a href="?p=ultimasnoticias&pagina=<?php echo $i; ?>"><?php echo $i; ?></a>
</li>
I hope I’ve helped.
Thank you very much!
2
To decrease the code can also be:
<nav>
<ul>
<li>
<a href="?p=ultimasnoticias&pagina=<?=$i?>"><?=$i?>
</a>
</li>
Browser other questions tagged php html string-concatenation
You are not signed in. Login or sign up in order to post.
The file that contains html has the extension
.html
? Or is.php
?– Andrei Coelho
@Andreicoelho The extension of all files are
.php
. But I’ve already solved it, thank you.– Susi