更正一下
<?php
/**
* Created by PhpStorm.
* User: juyaobin
* Date: 2018/8/7
* Time: 上午9:55
*/
//4.php
function HouZhuiMing($b='4.php'){
$a = strrchr($b,'.' );
return $a;
}
var_dump( HouZhuiMing('4.txt.html'));
<?php
/**
* Created by PhpStorm.
* User: juyaobin
* Date: 2018/8/7
* Time: 上午9:55
*/
//4.php
function HouZhuiMing($b='4.php'){
$a = strrchr($b,'.' );
return $a;
}
var_dump( HouZhuiMing('4.txt.html'));
2018-08-07
作业
<?php
/**
* Created by PhpStorm.
* User: juyaobin
* Date: 2018/8/7
* Time: 上午9:55
*/
//4.php
function HouZhuiMing($b='4.php'){
$a = strstr($b,'.');
return $a;
}
var_dump( HouZhuiMing('4.txt'));
<?php
/**
* Created by PhpStorm.
* User: juyaobin
* Date: 2018/8/7
* Time: 上午9:55
*/
//4.php
function HouZhuiMing($b='4.php'){
$a = strstr($b,'.');
return $a;
}
var_dump( HouZhuiMing('4.txt'));
2018-08-07
function getExt($filename){
$arr = explode('.',$filename);
$newArr = array_reverse($arr);
echo $newArr[0];
}
getExt($filename='1.txt.html');
课后作业
$arr = explode('.',$filename);
$newArr = array_reverse($arr);
echo $newArr[0];
}
getExt($filename='1.txt.html');
课后作业
2018-06-12
function getExtensionName($fileName){
preg_match('/\.(.+)/i',$fileName,$matches);
return $matches[1];
}
echo getExtensionName('index.txt');
preg_match('/\.(.+)/i',$fileName,$matches);
return $matches[1];
}
echo getExtensionName('index.txt');
2018-05-06
<?php
function getExt($filename) {
$ext = substr(strstr($filename, '.'), 1);
return $ext;
}
echo getExt('adfhadkghaf.ppp');
function getExt($filename) {
$ext = substr(strstr($filename, '.'), 1);
return $ext;
}
echo getExt('adfhadkghaf.ppp');
2018-05-01