> „ > >

PHPexplodeimplodeą^e

Wվ݋ 2020-03-09 20:11 / ھWվO / g
1implode(sep,array)һMֽMϞһַɔMԪؽMϳɵַ
sepxҎMԪ֮gõăĬJ""ַarrayҎҪֵĔM
<!DOCTYPE html>
<html>
<body>
 
<?php
$arr = array('Hello','World!','I','like','php!');
echo implode(" ",$arr);
?>
 
 
</body>
</html>
ݔHello World! I like php!
2explode(sep,string,limit)һַϞһMַĔM
sepҎַָstringҎҪַָlimitǿxҎصĔMԪصĔĿ
<!DOCTYPE html>
<html>
<body>
 
<?php
$str = "Hello world. I like php!";
print_r (explode(" ",$str));
?>
  
 
</body>
</html>
ݔArray ( [0] => Hello [1] => world. [2] => I [3] => like [4] => php! )
 
ŷzoozݽ_ŷ̫Ƭ_ŷձһ