以下函数可以快速获取文件的扩展名即后缀。代码如下:functiongetExtension($filename){$myext=substr($filename,strrpos($filename,'.'));returnstr_replace('.','',$myext);}使... |
发表时间:2024-03-27 |
点击数:28 |
查看全文 |
$domain='www.example.com';$records=dns_get_record($domain,DNS_ALL);echo'当前域名的解析记录为:';foreach($recordsas$record){echo'{$record['host']}{$reco... |
发表时间:2024-02-28 |
点击数:11 |
查看全文 |
$url='http://www.example.com';$headers=@get_headers($url);if($headers){$status_code=substr($headers[0],9,3);echo'当前域名状态为:'.$status_code;}els... |
发表时间:2024-02-28 |
点击数:16 |
查看全文 |
$prefix=explode('.',$_SERVER['HTTP_HOST'])[0];echo'当前域名的前缀为:'.$prefix;... |
发表时间:2024-02-28 |
点击数:7 |
查看全文 |
$filename=basename($_SERVER['PHP_SELF']);echo'当前文件名为:'.$filename;... |
发表时间:2024-02-28 |
点击数:10 |
查看全文 |
$ip=gethostbyname($_SERVER['HTTP_HOST']);echo'当前域名的IP地址为:'.$ip;... |
发表时间:2024-02-28 |
点击数:7 |
查看全文 |
一、把关键字专门写在一个文本文件里,每行一个,数量不限,有多少写多少。二、PHP读取关键字文本,存入一个数组三、遍历关键字数组,挨个用strpos函数去看看内容有没有关键字,如果有,返回true,没有则返回falsePHP代码如下:代码如下:/*PHP中用strpos函数过滤关键... |
发表时间:2024-02-22 |
点击数:13 |
查看全文 |
config.XML文件:?xmlversion='1.0'encoding='UTF-8'?nodestudentname张明/[email protected]/emailusername一样菜/usernamecode985931/code/student... |
发表时间:2024-02-22 |
点击数:7 |
查看全文 |
functiongetfilecounts($ff){$dir='./'.$ff;$handle=opendir($dir);$i=0;while(false!==$file=(readdir($handle))){if($file!=='.'$file!='..'){$i++;... |
发表时间:2024-02-22 |
点击数:9 |
查看全文 |
如何创建cookie?setcookie()函数用于设置cookie。注释:setcookie()函数必须位于html标签之前。创建您的第一个PHPcookie当您创建一个cookie,使用函数setcookie,你必须指定三个参数。这些参数是setcookie(名称,值,过期)... |
发表时间:2024-02-19 |
点击数:10 |
查看全文 |