Esta es una pregunta rápida pero sencilla. Estoy teniendo un mal día y no sé cómo hacer esto:Cómo ejecutar una función dentro de una llamada de eco
Lo que necesito hacer es esto ...
estoy comprobando para PMD en la url de ser así eco de esto:
<?php
if (isset($_GET['pmd'])) {
echo"<div class=\"response\"><p style=\"width:350px; height:200px; vertical-align:middle;\"><strong>Thank you for acting as a "watchman on the walls" of Jerusalem! Your name will now appear on our virtual wall.<br><br>You can also catch up on the latest news from Israel by visiting our news feed below.</strong></p></div>";
}else { etc...
Lo que necesito incluir dentro de eso es una imagen como tal que está disparando un píxel de seguimiento.
<img src="url.com?cid=12345&aid=1234&oid=<?php echo mt_rand(); ?>&quantity=1" height="1" width="1" />
Lo que me gustaría tener es:
<?php
if (isset($_GET['pmd'])) {
echo"<div class=\"response\"><p style=\"width:350px; height:200px; vertical-align:middle;\"><strong>Thank you for acting as a "watchman on the walls" of Jerusalem! Your name will now appear on our virtual wall.<br><br>You can also catch up on the latest news from Israel by visiting our news feed below.</strong></p>
<br />
<img src="url.com?cid=12345&aid=1234&oid=<?php echo mt_rand(); ?>&quantity=1" height="1" width="1" />
</div>";
}else {
¿Qué tengo que hacer para conseguir que la función() mt_rand al fuego?
Gracias,
Matt
Debe utilizar '&' en las URL, no '&'. – Artefacto
Si no quiere escapar de las comillas de la cadena (lo hace más difícil de leer), simplemente encierre la cadena en ''' en vez de' "'. –