Skip to content

Commit

Permalink
Sync random_int and strrchr (#803)
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-records authored Oct 27, 2023
1 parent eeda7ab commit c7834b3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions bookinfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<othercredit class="translator"> <personname>肖盛文</personname> </othercredit>
<othercredit class="translator"> <personname>褚兆玮</personname> </othercredit>
<othercredit class="translator"> <personname>鲍国枭</personname> </othercredit>
<othercredit class="translator"> <personname>鲁飞</personname> </othercredit>
</authorgroup>


Expand Down
5 changes: 3 additions & 2 deletions reference/random/functions/random-int.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 553952f03f444f2c130c35de0d1ea8dc04fa0cf9 Maintainer: mowangjuanzi Status: ready -->
<!-- EN-Revision: 0ec8e36e0f649354b20c714080a903d32df4dbfb Maintainer: mowangjuanzi Status: ready -->
<!-- CREDITS: Luffy -->
<refentry xml:id="function.random-int" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>random_int</refname>
Expand Down Expand Up @@ -115,7 +116,7 @@ int(-898)
<refsect1 role="seealso"><!-- {{{ -->
&reftitle.seealso;
<simplelist>
<member><function>Random\Randomizer::getInt</function></member>
<member><methodname>Random\Randomizer::getInt</methodname></member>
<member><function>random_bytes</function></member>
</simplelist>
</refsect1><!-- }}} -->
Expand Down
21 changes: 13 additions & 8 deletions reference/strings/functions/strrchr.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 31d54a1c340cec9b15047f9f398d10e15f59f934 Maintainer: daijie Status: ready -->
<!-- EN-Revision: 654ee5c8afdf4ee721befdd0937fa155c50dca43 Maintainer: daijie Status: ready -->
<!-- CREDITS: mowangjuanzi, Luffy -->
<refentry xml:id="function.strrchr" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
Expand Down Expand Up @@ -106,16 +106,21 @@
<programlisting role="php">
<![CDATA[
<?php
// 获取 $PATH 中不含磁盘符号的目录
$dir = substr(strrchr($PATH, ":"), 1);
// 获取最后一行内容
$text = "Line 1\nLine 2\nLine 3";
$last = substr(strrchr($text, 10), 1 );
$ext = strrchr('somefile.txt', '.');
echo "file extension: $ext \n";
$ext = $ext ? strtolower(substr($ext, 1)) : '';
echo "file extension: $ext";
?>
]]>
</programlisting>
</example>
&example.outputs.similar;
<screen>
<![CDATA[
file extension: .txt
file extension: txt
]]>
</screen>
</example>
</para>
</refsect1>

Expand Down

0 comments on commit c7834b3

Please sign in to comment.