2012-05-18 30 views
0

我有一個顯示來自一個會話的數值以下echo語句:因此,如果$row_WAATKgblqemplisting['Group']如果echo聲明中的值爲2,則顯示文本?

等於2,它說

<?php echo(str_replace('"', '&quot;', $row_WAATKgblqemplisting['Group'])); ?> 

如何改變這樣的說法:這是#2 如果它等於1它說:這是#1 ,如果它等於3它說:這是#3?

回答

2
echo 'This is #' . $row_WAATKgblqemplisting['Group']; 

如果要寫入HTML,你可以使用實體&#35;而不是ASCII的#

0
$number = $row_WAATKgblqemplisting['Group']; 
echo 'This is &#35;'.$number; 

這就是你想要做的?

0
echo "This is #{$row_WAATKgblqemplisting['Group']}\n";