Home  >  Q&A  >  body text

About trim function

<!DOCTYPE html>
<html>
<body>
<?php
$str = "Hello World!";
echo $str . " <br>". "<br>";
echo trim($str,"Herld!");
?>
</body>
</html>

The output result is:

Hello World!

o Wo

Shouldn’t the second line be: llo Wo?

益伦益伦2494 days ago1313

reply all(2)I'll reply

  • 小崔

    小崔2017-11-23 17:34:46

    Because ll was cleared by the trim function

    reply
    0
  • 益伦

    Thank you!

    益伦 · 2017-11-23 21:33:04
  • Cancelreply