首页 > 代码库 > php的explode()和split()的区别

php的explode()和split()的区别

都是分割,区别就是,split要用转移字符:
1.
   $test = end(explode(‘.‘, ‘abc.txt‘));
   echo $test;//output txt
 
2.
   $test1 = end(split(‘.‘,‘abc.txt‘));
   echo $test1;//no output
 
3.
  $test1 = end(split(‘\.‘,‘abc.txt‘));
   echo $test1;//output txt 

php的explode()和split()的区别