收藏PHP常用函式

2021-05-27 13:29:23 字數 1514 閱讀 6039

//收藏php常用函式

function getip() else else","",$fnum);

if($fnum=="") $fnum=0;

return $fnum;

//去除html標記

function text2html($txt)/isu","

rn",$txt);

return $txt;

//相對路徑轉化成絕對路徑

function relative_to_absolute($content, $feed_url) else ",$table);

//去掉 html 標記

$table = preg_replace("'<[/!]*?[^<>]*?>'si","",$table);

//去掉空白字元

$table = preg_replace("'([rn])[s]+'","",$table);

$table = str_replace(" ","",$table);

$table = str_replace(" ","",$table);

$table = explode(",",$table);

array_pop($table);

return $table;

//將html**的每行每列轉為陣列,採集**資料

function get_td_array($table) ",$table);

$table = str_replace("","",$table);

//去掉 html 標記

$table = preg_replace("'<[/!]*?[^<>]*?>'si","",$table);

//去掉空白字元

$table = preg_replace("'([rn])[s]+'","",$table);

$table = str_replace(" ","",$table);

$table = str_replace(" ","",$table);

$table = explode('', $table);

array_pop($table);

foreach ($table as $key=>$tr) ', $tr);

array_pop($td);

$td_array = $td;

return $td_array;

//返回字串中的所有單詞 $distinct=true 去除重複

function split_en_str($str,$distinct=true) {

preg_match_all('/([a-za-z]+)/',$str,$match);

if ($distinct == true) {

$match[1] = array_unique($match[1]);

sort($match[1]);

return $match[1];

//列印出為本php專案做出貢獻的人員的清單

string phpcredits(void)

php 常用函式收藏(二)

讀取快取,預設為檔案快取,不載入快取配置。param string name 快取名稱 param filepath 資料路徑 模組名稱 caches cache filepath param string config 配置名稱 function getcacheinfo name,filepat...

ORACLE常用函式收藏

1.substr substr string,start,count 取子字串,從start開始,取count個 2.to number 例子declare v c number v pc varchar2 100 v p number begin select d.data name into v...

MySQL常用函式(建議收藏)

一 數學函式 數學函式主要用於處理數字,包括整型 浮點數等。abs x 返回x的絕對值 select abs 1 返回1 ceil x ceiling x 返回大於或等於x的最小整數 select ceil 1.5 返回2 floor x 返回小於或等於x的最大整數 select floor 1.5...