|
導讀網(wǎng)頁的本質(zhì)就是超級文本標記語言,通過結(jié)合使用其他的Web技術(shù)(如:腳本語言、公共網(wǎng)關(guān)接口、組件等),可以創(chuàng)造出功能強大的網(wǎng)頁。因而,超級文本標記語言是萬維網(wǎng)(Web)編程的基礎(chǔ),也就是說萬維網(wǎng)是建立... 網(wǎng)頁的本質(zhì)就是超級文本標記語言,通過結(jié)合使用其他的Web技術(shù)(如:腳本語言、公共網(wǎng)關(guān)接口、組件等),可以創(chuàng)造出功能強大的網(wǎng)頁。因而,超級文本標記語言是萬維網(wǎng)(Web)編程的基礎(chǔ),也就是說萬維網(wǎng)是建立在超文本基礎(chǔ)之上的。超級文本標記語言之所以稱為超文本標記語言,是因為文本中包含了所謂“超級鏈接”點。 PHP的功能越來越強大,里面有著非常豐富的內(nèi)置函數(shù)。資深的PHP程序員對它們可能都很熟悉,但很多參加PHP培訓的PHP初學者,仍然對一些非常有用的函數(shù)不太熟悉。這里我們就列舉10個你或許不了解但實用的PHP函數(shù),同時PHP中文網(wǎng)也提供了豐富的PHP類庫資源,可供大家下載參考學習。 1.php_check_syntax 這個函數(shù)可以用來檢查特定文件中的PHP語法是否正確。 <?php
$error_message = "";
$filename = "./php_script.php";
if(!php_check_syntax($filename, &$error_message)) {
echo "Errors were found in the file $filename: $error_
} else {
echo "The file $filename contained no syntax errors";
}
?>2. highlight_string <?php
highlight_string(' <?php phpinfo(); ?>');
?>3. show_source <?php
show_source("php_script.php");
?>4. php_strip_whitespace <?php
echo php_strip_whitespace("php_script.php");
?>5. _halt_compiler <?php $fp = fopen(__FILE__, 'r'); fseek($fp, __COMPILER_HALT_OFFSET__); var_dump(stream_get_contents($fp)); // the end of the script execution __halt_compiler(); ?> 6. highlight_file <?php
highlight_file("php_script.php");
?>7. ignore_user_abort <?php ignore_user_abort(); ?> 8. str_word_count <?php
echo str_word_count("Hello How Are You!");
?>9. get_defined_vars <?php print_r(get_defined_vars()); ?> 10. get_browser <?php echo $_SERVER['HTTP_USER_AGENT']; $browser = get_browser(); print_r($browser); ?> 想要了解更多PHP知識,大家可以關(guān)注PHP中文網(wǎng)PHP視頻教程,歡迎 大家參考學習! 以上就是分享PHP中的10個實用函數(shù)!(附代碼)的詳細內(nèi)容,更多請關(guān)注php中文網(wǎng)其它相關(guān)文章! 網(wǎng)站建設(shè)是一個廣義的術(shù)語,涵蓋了許多不同的技能和學科中所使用的生產(chǎn)和維護的網(wǎng)站。 |
溫馨提示:喜歡本站的話,請收藏一下本站!