1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Fix local deployement and add a new doc page (#1181)

Co-authored-by: Sergey Panteleev <sergey@php.net>
This commit is contained in:
Gina Peter Banyard
2024-12-11 09:48:39 +00:00
committed by GitHub
parent 850039a5ee
commit 50202bbf27
10 changed files with 894 additions and 278 deletions

View File

@@ -53,31 +53,57 @@ manual_setup($setup);
<h1 class="title">Variable handling</h1>
<ul class="chunklist chunklist_book"><li><a href="intro.var.php">Introduction</a></li><li><a href="var.setup.php">Installing/Configuring</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="var.requirements.php">Requirements</a></li><li><a href="var.installation.php">Installation</a></li><li><a href="var.configuration.php">Runtime Configuration</a></li><li><a href="var.resources.php">Resource Types</a></li></ul></li><li><a href="var.constants.php">Predefined Constants</a></li><li><a href="ref.var.php">Variable handling Functions</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="function.boolval.php">boolval</a> — Get the boolean value of a variable</li><li><a href="function.debug-zval-dump.php">debug_zval_dump</a> — Dumps a string representation of an internal zend value to output</li><li><a href="function.doubleval.php">doubleval</a> — Alias of floatval</li><li><a href="function.empty.php">empty</a> — Determine whether a variable is empty</li><li><a href="function.floatval.php">floatval</a> — Get float value of a variable</li><li><a href="function.get-defined-vars.php">get_defined_vars</a> — Returns an array of all defined variables</li><li><a href="function.get-resource-type.php">get_resource_type</a> — Returns the resource type</li><li><a href="function.gettype.php">gettype</a> — Get the type of a variable</li><li><a href="function.import-request-variables.php">import_request_variables</a> — Import GET/POST/Cookie variables into the global scope</li><li><a href="function.intval.php">intval</a> — Get the integer value of a variable</li><li><a href="function.is-array.php">is_array</a> — Finds whether a variable is an array</li><li><a href="function.is-bool.php">is_bool</a> — Finds out whether a variable is a boolean</li><li><a href="function.is-callable.php">is_callable</a> — Verify that the contents of a variable can be called as a function</li><li><a href="function.is-double.php">is_double</a> — Alias of is_float</li><li><a href="function.is-float.php">is_float</a> — Finds whether the type of a variable is float</li><li><a href="function.is-int.php">is_int</a> — Find whether the type of a variable is integer</li><li><a href="function.is-integer.php">is_integer</a> — Alias of is_int</li><li><a href="function.is-long.php">is_long</a> — Alias of is_int</li><li><a href="function.is-null.php">is_null</a> — Finds whether a variable is NULL</li><li><a href="function.is-numeric.php">is_numeric</a> — Finds whether a variable is a number or a numeric string</li><li><a href="function.is-object.php">is_object</a> — Finds whether a variable is an object</li><li><a href="function.is-real.php">is_real</a> — Alias of is_float</li><li><a href="function.is-resource.php">is_resource</a> — Finds whether a variable is a resource</li><li><a href="function.is-scalar.php">is_scalar</a> — Finds whether a variable is a scalar</li><li><a href="function.is-string.php">is_string</a> — Find whether the type of a variable is string</li><li><a href="function.isset.php">isset</a> — Determine if a variable is set and is not NULL</li><li><a href="function.print-r.php">print_r</a> — Prints human-readable information about a variable</li><li><a href="function.serialize.php">serialize</a> — Generates a storable representation of a value</li><li><a href="function.settype.php">settype</a> — Set the type of a variable</li><li><a href="function.strval.php">strval</a> — Get string value of a variable</li><li><a href="function.unserialize.php">unserialize</a> — Creates a PHP value from a stored representation</li><li><a href="function.unset.php">unset</a> — Unset a given variable</li><li><a href="function.var-dump.php">var_dump</a> — Dumps information about a variable</li><li><a href="function.var-export.php">var_export</a> — Outputs or returns a parsable string representation of a variable</li></ul></li></ul></div><?php manual_footer(); ?>
<ul class="chunklist chunklist_book">
<li><a href="intro.var.php">Introduction</a></li>
<li>
<a href="var.setup.php">Installing/Configuring</a>
<ul class="chunklist chunklist_book chunklist_children">
<li><a href="var.requirements.php">Requirements</a></li>
<li><a href="var.installation.php">Installation</a></li>
<li><a href="var.configuration.php">Runtime Configuration</a></li>
<li><a href="var.resources.php">Resource Types</a></li>
</ul>
</li>
<li><a href="var.constants.php">Predefined Constants</a></li>
<li>
<a href="ref.var.php">Variable handling Functions</a>
<ul class="chunklist chunklist_book chunklist_children">
<li><a href="function.boolval.php">boolval</a> — Get the boolean value of a variable</li>
<li><a href="function.debug-zval-dump.php">debug_zval_dump</a> — Dumps a string representation of an internal zend value to output</li>
<li><a href="function.doubleval.php">doubleval</a> — Alias of floatval</li>
<li><a href="function.empty.php">empty</a> — Determine whether a variable is empty</li>
<li><a href="function.floatval.php">floatval</a> — Get float value of a variable</li>
<li><a href="function.get-defined-vars.php">get_defined_vars</a> — Returns an array of all defined variables</li>
<li><a href="function.get-resource-type.php">get_resource_type</a> — Returns the resource type</li>
<li><a href="function.gettype.php">gettype</a> — Get the type of a variable</li>
<li><a href="function.import-request-variables.php">import_request_variables</a> — Import GET/POST/Cookie variables into the global scope</li>
<li><a href="function.intval.php">intval</a> — Get the integer value of a variable</li>
<li><a href="function.is-array.php">is_array</a> — Finds whether a variable is an array</li>
<li><a href="function.is-bool.php">is_bool</a> — Finds out whether a variable is a boolean</li>
<li><a href="function.is-callable.php">is_callable</a> — Verify that the contents of a variable can be called as a function</li>
<li><a href="function.is-double.php">is_double</a> — Alias of is_float</li>
<li><a href="function.is-float.php">is_float</a> — Finds whether the type of a variable is float</li>
<li><a href="function.is-int.php">is_int</a> — Find whether the type of a variable is integer</li>
<li><a href="function.is-integer.php">is_integer</a> — Alias of is_int</li>
<li><a href="function.is-long.php">is_long</a> — Alias of is_int</li>
<li><a href="function.is-null.php">is_null</a> — Finds whether a variable is NULL</li>
<li><a href="function.is-numeric.php">is_numeric</a> — Finds whether a variable is a number or a numeric string</li>
<li><a href="function.is-object.php">is_object</a> — Finds whether a variable is an object</li>
<li><a href="function.is-real.php">is_real</a> — Alias of is_float</li>
<li><a href="function.is-resource.php">is_resource</a> — Finds whether a variable is a resource</li>
<li><a href="function.is-scalar.php">is_scalar</a> — Finds whether a variable is a scalar</li>
<li><a href="function.is-string.php">is_string</a> — Find whether the type of a variable is string</li>
<li><a href="function.isset.php">isset</a> — Determine if a variable is set and is not NULL</li>
<li><a href="function.print-r.php">print_r</a> — Prints human-readable information about a variable</li>
<li><a href="function.serialize.php">serialize</a> — Generates a storable representation of a value</li>
<li><a href="function.settype.php">settype</a> — Set the type of a variable</li>
<li><a href="function.strval.php">strval</a> — Get string value of a variable</li>
<li><a href="function.unserialize.php">unserialize</a> — Creates a PHP value from a stored representation</li>
<li><a href="function.unset.php">unset</a> — Unset a given variable</li>
<li><a href="function.var-dump.php">var_dump</a> — Dumps information about a variable</li>
<li><a href="function.var-export.php">var_export</a> — Outputs or returns a parsable string representation of a variable</li>
</ul>
</li>
</ul>
</div>
<?php manual_footer([]); ?>

View File

@@ -205,87 +205,18 @@ manual_setup($setup);
</div>
<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="exception.construct.php">Exception::__construct</a> — Construct the exception</li><li><a href="exception.getmessage.php">Exception::getMessage</a> — Gets the Exception message</li><li><a href="exception.getprevious.php">Exception::getPrevious</a> — Returns previous Exception</li><li><a href="exception.getcode.php">Exception::getCode</a> — Gets the Exception code</li><li><a href="exception.getfile.php">Exception::getFile</a> — Gets the file in which the exception occurred</li><li><a href="exception.getline.php">Exception::getLine</a> — Gets the line in which the exception occurred</li><li><a href="exception.gettrace.php">Exception::getTrace</a> — Gets the stack trace</li><li><a href="exception.gettraceasstring.php">Exception::getTraceAsString</a> — Gets the stack trace as a string</li><li><a href="exception.tostring.php">Exception::__toString</a> — String representation of the exception</li><li><a href="exception.clone.php">Exception::__clone</a> — Clone the exception</li></ul>
<h2>Table of Contents</h2>
<ul class="chunklist chunklist_reference">
<li><a href="exception.construct.php">Exception::__construct</a> — Construct the exception</li>
<li><a href="exception.getmessage.php">Exception::getMessage</a> — Gets the Exception message</li>
<li><a href="exception.getprevious.php">Exception::getPrevious</a> — Returns previous Exception</li>
<li><a href="exception.getcode.php">Exception::getCode</a> — Gets the Exception code</li>
<li><a href="exception.getfile.php">Exception::getFile</a> — Gets the file in which the exception occurred</li>
<li><a href="exception.getline.php">Exception::getLine</a> — Gets the line in which the exception occurred</li>
<li><a href="exception.gettrace.php">Exception::getTrace</a> — Gets the stack trace</li>
<li><a href="exception.gettraceasstring.php">Exception::getTraceAsString</a> — Gets the stack trace as a string</li>
<li><a href="exception.tostring.php">Exception::__toString</a> — String representation of the exception</li>
<li><a href="exception.clone.php">Exception::__clone</a> — Clone the exception</li>
</ul>
</div>
<?php manual_footer(); ?>
<?php manual_footer([]); ?>

View File

@@ -438,4 +438,4 @@ array (
</div>
</div><?php manual_footer(); ?>
</div><?php manual_footer([]); ?>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,190 @@
<?php
include_once __DIR__ . '/../../include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once __DIR__ ."/toc/ref.strings.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'function.rtrim.php',
1 => 'rtrim',
),
'up' =>
array (
0 => 'ref.strings.php',
1 => 'String Functions',
),
'prev' =>
array (
0 => 'function.strpos.php',
1 => 'strpos',
),
'alternatives' =>
array (
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
?>
<div id="function.rtrim" class="refentry">
<div class="refnamediv">
<h1 class="refname">rtrim</h1>
<p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">rtrim</span> &mdash; <span class="dc-title">Strip whitespace (or other characters) from the end of a string</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.rtrim-description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>rtrim</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$string</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$characters</code><span class="initializer"> = &quot; \n\r\t\v\x00&quot;</span></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>
<p class="simpara">
This function returns a string with whitespace (or other characters) stripped from the
end of <code class="parameter">string</code>.
</p>
<p class="simpara">
Without the second parameter,
<span class="function"><strong>rtrim()</strong></span> will strip these characters:
</p>
<ul class="itemizedlist">
<li class="listitem">
<span class="simpara">
<code class="literal">&quot; &quot;</code>: <abbr title="American Standard Code for Information Interchange">ASCII</abbr> <abbr>SP</abbr> character
<code class="literal">0x20</code>, an ordinary space.
</span>
</li>
<li class="listitem">
<span class="simpara">
<code class="literal">&quot;\t&quot;</code>: <abbr title="American Standard Code for Information Interchange">ASCII</abbr> <abbr>HT</abbr> character
<code class="literal">0x09</code>, a tab.
</span>
</li>
<li class="listitem">
<span class="simpara">
<code class="literal">&quot;\n&quot;</code>: <abbr title="American Standard Code for Information Interchange">ASCII</abbr> <abbr>LF</abbr> character
<code class="literal">0x0A</code>, a new line (line feed).
</span>
</li>
<li class="listitem">
<span class="simpara">
<code class="literal">&quot;\r&quot;</code>: <abbr title="American Standard Code for Information Interchange">ASCII</abbr> <abbr>CR</abbr> character
<code class="literal">0x0D</code>, a carriage return.
</span>
</li>
<li class="listitem">
<span class="simpara">
<code class="literal">&quot;\0&quot;</code>: <abbr title="American Standard Code for Information Interchange">ASCII</abbr> <abbr>NUL</abbr> character
<code class="literal">0x00</code>, the NUL-byte.
</span>
</li>
<li class="listitem">
<span class="simpara">
<code class="literal">&quot;\v&quot;</code>: <abbr title="American Standard Code for Information Interchange">ASCII</abbr> <abbr>VT</abbr>
character <code class="literal">0x0B</code>, a vertical tab.
</span>
</li>
</ul>
</div>
<div class="refsect1 parameters" id="refsect1-function.rtrim-parameters">
<h3 class="title">Parameters</h3>
<dl>
<dt><code class="parameter">string</code></dt>
<dd>
<span class="simpara">
The input string.
</span>
</dd>
<dt><code class="parameter">characters</code></dt>
<dd>
<span class="simpara">
Optionally, the stripped characters can also be specified using
the <code class="parameter">characters</code> parameter.
Simply list all characters that need to be stripped.
With <code class="literal">..</code> it is possible to specify an incrementing range of characters.
</span>
</dd>
</dl>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.rtrim-returnvalues">
<h3 class="title">Return Values</h3>
<p class="simpara">
Returns the modified string.
</p>
</div>
<div class="refsect1 examples" id="refsect1-function.rtrim-examples">
<h3 class="title">Examples</h3>
<div class="example" id="example-4971">
<p><strong>Example #1 Usage example of <span class="function"><strong>rtrim()</strong></span></strong></p>
<div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$text </span><span style="color: #007700">= </span><span style="color: #DD0000">"\t\tThese are a few words :) ... "</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$binary </span><span style="color: #007700">= </span><span style="color: #DD0000">"\x09Example string\x0A"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$hello </span><span style="color: #007700">= </span><span style="color: #DD0000">"Hello World"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$text</span><span style="color: #007700">, </span><span style="color: #0000BB">$binary</span><span style="color: #007700">, </span><span style="color: #0000BB">$hello</span><span style="color: #007700">);<br /><br />print </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$trimmed </span><span style="color: #007700">= </span><span style="color: #0000BB">rtrim</span><span style="color: #007700">(</span><span style="color: #0000BB">$text</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$trimmed</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$trimmed </span><span style="color: #007700">= </span><span style="color: #0000BB">rtrim</span><span style="color: #007700">(</span><span style="color: #0000BB">$text</span><span style="color: #007700">, </span><span style="color: #DD0000">" \t."</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$trimmed</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$trimmed </span><span style="color: #007700">= </span><span style="color: #0000BB">rtrim</span><span style="color: #007700">(</span><span style="color: #0000BB">$hello</span><span style="color: #007700">, </span><span style="color: #DD0000">"Hdle"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$trimmed</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// trim the ASCII control characters at the end of $binary<br />// (from 0 to 31 inclusive)<br /></span><span style="color: #0000BB">$clean </span><span style="color: #007700">= </span><span style="color: #0000BB">rtrim</span><span style="color: #007700">(</span><span style="color: #0000BB">$binary</span><span style="color: #007700">, </span><span style="color: #DD0000">"\x00..\x1F"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$clean</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
</div>
<div class="example-contents"><p>The above example will output:</p></div>
<div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">string(32) &quot; These are a few words :) ... &quot;
string(16) &quot; Example string
&quot;
string(11) &quot;Hello World&quot;
string(30) &quot; These are a few words :) ...&quot;
string(26) &quot; These are a few words :)&quot;
string(9) &quot;Hello Wor&quot;
string(15) &quot; Example string&quot;</pre>
</div>
</div>
</div>
<div class="example" id="similar_text.example.swapping">
<p><strong>Example #1 <span class="function"><strong>similar_text()</strong></span> argument swapping example</strong></p>
<div class="example-contents"><p>
This example shows that swapping the <code class="parameter">string1</code> and
<code class="parameter">string2</code> argument may yield different results.
</p></div>
<div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$sim </span><span style="color: #007700">= </span><span style="color: #0000BB">similar_text</span><span style="color: #007700">(</span><span style="color: #DD0000">'bafoobar'</span><span style="color: #007700">, </span><span style="color: #DD0000">'barfoo'</span><span style="color: #007700">, </span><span style="color: #0000BB">$perc</span><span style="color: #007700">);<br />echo </span><span style="color: #DD0000">"similarity: </span><span style="color: #0000BB">$sim</span><span style="color: #DD0000"> (</span><span style="color: #0000BB">$perc</span><span style="color: #DD0000"> %)\n"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$sim </span><span style="color: #007700">= </span><span style="color: #0000BB">similar_text</span><span style="color: #007700">(</span><span style="color: #DD0000">'barfoo'</span><span style="color: #007700">, </span><span style="color: #DD0000">'bafoobar'</span><span style="color: #007700">, </span><span style="color: #0000BB">$perc</span><span style="color: #007700">);<br />echo </span><span style="color: #DD0000">"similarity: </span><span style="color: #0000BB">$sim</span><span style="color: #DD0000"> (</span><span style="color: #0000BB">$perc</span><span style="color: #DD0000"> %)\n"</span><span style="color: #007700">;</span></span></code></div>
</div>
<div class="example-contents"><p>The above example will output
something similar to:</p></div>
<div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">similarity: 5 (71.428571428571 %)
similarity: 3 (42.857142857143 %)</pre>
</div>
</div>
</div>
</div>
<div class="refsect1 seealso" id="refsect1-function.rtrim-seealso">
<h3 class="title">See Also</h3>
<ul class="simplelist">
<li><span class="function"><a href="function.trim.php" class="function" rel="rdfs-seeAlso">trim()</a> - Strip whitespace (or other characters) from the beginning and end of a string</span></li>
<li><span class="function"><a href="function.ltrim.php" class="function" rel="rdfs-seeAlso">ltrim()</a> - Strip whitespace (or other characters) from the beginning of a string</span></li>
</ul>
</div>
</div><?php manual_footer([]); ?>

View File

@@ -26,13 +26,13 @@ $setup = array (
),
'prev' =>
array (
0 => 'function.strpbrk.php',
1 => 'strpbrk',
0 => 'ref.strings.php',
1 => 'String Functions',
),
'next' =>
array (
0 => 'function.strrchr.php',
1 => 'strrchr',
0 => 'function.rtrim.php',
1 => 'rtrim',
),
'alternatives' =>
array (
@@ -197,4 +197,4 @@ binary-safe.</span></p></blockquote>
</div>
</div><?php manual_footer(); ?>
</div><?php manual_footer([]); ?>

File diff suppressed because one or more lines are too long

View File

@@ -161,4 +161,4 @@ string(4) &quot;foo!&quot;
</div>
<?php manual_footer(); ?>
<?php manual_footer([]); ?>

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 KiB

After

Width:  |  Height:  |  Size: 410 KiB