svn: /phpdoc/ru/trunk/reference/strings/functions/ trim.xml
| From: | Shein Alexey | Date: | Tue, 10 May 2011 07:02:10 +0000 |
| Subject: | svn: /phpdoc/ru/trunk/reference/strings/functions/ trim.xml | ||
| Groups: | php.doc.ru | ||
| Request: | Send a blank email to doc-ru+get-1777@lists.php.net to get a copy of this message | ||
shein Tue, 10 May 2011 07:02:10 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=310873
Log:
Updated translation.
Changed paths:
U phpdoc/ru/trunk/reference/strings/functions/trim.xml
Modified: phpdoc/ru/trunk/reference/strings/functions/trim.xml
===================================================================
--- phpdoc/ru/trunk/reference/strings/functions/trim.xml 2011-05-10 06:26:00 UTC (rev 310872)
+++ phpdoc/ru/trunk/reference/strings/functions/trim.xml 2011-05-10 07:02:10 UTC (rev 310873)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!-- EN-Revision: 297028 Maintainer: shein Status: ready -->
+<!-- EN-Revision: 310860 Maintainer: shein Status: ready -->
<!-- Reviewed: no -->
<!-- $Revision$ -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
@@ -147,6 +147,9 @@
$trimmed = trim($hello, "Hdle");
var_dump($trimmed);
+$trimmed = trim($hello, 'HdWr');
+var_dump($trimmed);
+
// удаляем управляющие ASCII-символы с начала и конца $binary
// (от 0 до 31 включительно)
$clean = trim($binary, "\x00..\x1F");
@@ -166,6 +169,7 @@
string(28) "These are a few words :) ..."
string(24) "These are a few words :)"
string(5) "o Wor"
+string(9) "ello Worl"
string(14) "Example string"
]]>
</screen>
@@ -217,12 +221,29 @@
</para>
</refsect1>
+ <refsect1 role="notes">
+ &reftitle.notes;
+ <note>
+ <title>Возможные трюки: удаление символов из
середины строки</title>
+ <para>
+ Так как <function>trim</function> удаляет символы с
начала
+ и конца строки <type>string</type>, то удаление (или
неудаление)
+ символов из середины строки может ввести в
недоумение.
+ <literal>trim('abc', 'bad')</literal> удалит как
'a', так и 'b',
+ потому что удаление 'a' сдвинет 'b' к началу
строки, что также
+ позволит ее удалить. Вот почему это "работает",
тогда как
+ <literal>trim('abc', 'b')</literal> очевидно нет.
+ </para>
+ </note>
+ </refsect1>
+
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ltrim</function></member>
<member><function>rtrim</function></member>
+ <member><function>str_replace</function></member>
</simplelist>
</para>
</refsect1>