2011-11-04 108 views

回答

4

直接從PHP.net(gettype()):

個爲返回的字符串

候選條件值是:

... 「雙規」(由於歷史原因,「雙」返回在浮動的情況下,而不是簡單的「浮動」) .. 。

0
<br> 
<?php 
     /*begins with a function that runs a Console msg for PHP */ 
function console_sn($txt){ 
$temp = ""; 
$temp .= "<script>"; 
$temp .= "console.info('frm_PHP: '+'"; 
$temp .= $txt; 
$temp .= "');"; 
$temp .= "</script>"; 
echo $temp; 
} 
echo("<br><hr><br>"); 
//end of PHP console function 

//Main primary code for this Example begins below 

//run these examples below in your test PHP file and see the results in your JS console window 

//e.g.#1 
$code1 = "1212"; 
console_sn(gettype(floatval($code1))); 

//e.g.#2 
$code2 = "1212sn"; 
console_sn(gettype(floatval($code2))); 

//e.g.#3 
$code3 = "1212"; 
console_sn(gettype((trim($code3))*1)); 

//e.g.#4 
$code4 = "1212sn"; 
console_sn(gettype((trim($code4))*1)); 

?> 
+1

複製和粘貼上面的代碼塊到PHP測試文件,並查看結果會出現在你的Javascript _ ** **控制檯窗口_。 – sameerNAT

相關問題