我有PHP代碼與標題輸出問題。如何從「空格」分開的話:(例1,例2,...)到(例1,例2,...)
例子: 如果我有這樣的標題詞:「例1,例2,示例3,範例4,......」這個稱號擴大我的雲格的風格。
輸出。$行[ '標題']。 768,16 獨立話從例1,例2,示例3至例1,例2,示例3,......有空格,但事實並非如此。如何改變這個會導致這個問題的代碼?
感謝的。
<?php
function print_cloud()
{ global $use_ads_scrl; $res=""; if ($use_ads_scrl=="yes"){$res=print_cloud2();} return $res; }
function print_cloud2()
{
global $table_ads, $HTTP_GET_VARS;
$city_sch="";
if ($HTTP_GET_VARS['city']!=""){$city_sch="and city='".$HTTP_GET_VARS['city']."' ";}
$sql_query="select * from $table_ads where (adcommkey is null or adcommkey=0) and visible=1 $city_sch
order by RAND() limit 10";
$sql_res=mysql_query("$sql_query");
$min = '10'; // Minimum font size in pixel.
$max = '22'; // Maximum font size in pixel.
$k1=""; $html_res="";
while ($row = mysql_fetch_array($sql_res)){
$k1="1";
if($row['adphotos']=='yes'){$check_ph=$photo_mark;} else {$check_ph="";}
$html_res=$html_res."
<a style='font-size:".rand($min,$max)."px; font-family:tahoma,sans-serif;'
class=\"tag_cloud\"
href='index.php?md=details&id= ".$row['idnum']." '> ".$row['title']." </a>
";
}
$html_res="
$html_res
";
if ($k1==""){$html_res="";}
return $html_res;
}
?>
你確定你發佈正確的代碼? – Peon