Ciao a tutti,
come posso fare per usare un if all'interno di una stringa ?
Esempio:
$str = "testo testo testo <?php if .... echo "pippo" else echo "pasticcio"> testo testo testo"
Grazie
Ciao a tutti,
come posso fare per usare un if all'interno di una stringa ?
Esempio:
$str = "testo testo testo <?php if .... echo "pippo" else echo "pasticcio"> testo testo testo"
Grazie
www.beppegrillo.it
Il blog di Beppe!!
codice:if(.......) { $str = "testo testo testo \"pippo\" testo testo testo"; } else { $str = "testo testo testo \"pasticcio\" testo testo testo"; }
Il silenzio è spesso la cosa migliore. Pensa ... è gratis.
Grazie
www.beppegrillo.it
Il blog di Beppe!!
Oppure....
$a = 0;
$str = "testo testo testo ". ($a == 4 ? "pippo" : "pasticcio"). "testo testo testo";
print $str;