PHP中的trim()实际上是如何工作的? [英] How actually trim() in PHP works ?
本文介绍了PHP中的trim()实际上是如何工作的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我实际上对trim()的工作原理感到困惑。
当我用的时候
I'm actually confused with how trim() works.
when I used
$str = "HelloWolrld";
echo trim($str,"Hoel");
输出 Wolrld
但是当我使用
the output is Wolrld
but when I used
$str = "abcdefghij";
echo trim($str,"ahcb");
输出 defghij
以及我用的时候
the output is defghij
and also when I used
$str = "abcdefghij";
echo trim($str,"acb");
输出 defghij
< br $>
实际修剪()的工作原理是什么?它在哪个基础上修剪掉字母?
the output is defghij
How actually trim() works ? On which basis it trims off the letters ?
推荐答案
str = HelloWolrld跨度>;
echo trim(
str = "HelloWolrld"; echo trim(
str, < span class =code-string> Hoel);
输出 Wolrld
但是当我使用时
the output is Wolrld
but when I used
str = abcdefghij< /跨度>;
echo trim(
str = "abcdefghij"; echo trim(
这篇关于PHP中的trim()实际上是如何工作的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文