截取替換php
$bank_num= 1234567891231496;html
substr_replace($bank_num, '*****', 6, 8) 數組
$bank_num是整數,'*****'替換內容,6是開始位數,8是替換個數curl
floatval用於獲取變量的浮點值。ide
$var = '122.34343runoob';url
$float_value_of_var = floatval ($var);spa
echo $float_value_of_var;
122.34343
explode(',', $list['hk_img']);數組轉字符串code
php 抓取頁面內容htm
$html
=
file_get_contents
(
$url
);
//若是出現中文亂碼使用下面代碼
//$getcontent = iconv("gb2312", "utf-8",$html);
echo
"<textarea style='width:800px;height:600px;'>"
.
$html
.
"</textarea>"
;
$ch
= curl_init();
curl_setopt(
$ch
, CURLOPT_URL,
$url
);
curl_setopt(
$ch
, CURLOPT_RETURNTRANSFER, 1);
curl_setopt(
$ch
, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt(
$ch
, CURLOPT_FOLLOWLOCATION, 1);
$html
= curl_exec(
$ch
);
curl_close(
$ch
);
echo
"<textarea style='width:800px;height:600px;'>"
.
$html
.
"</textarea>"
;