mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Add floatval() example for non-numeric strings
--- Provided by Mark T (mxtracks@gmail.com) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@332352 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
e0815cb568
commit
03083e6a66
1 changed files with 14 additions and 0 deletions
|
@ -57,6 +57,20 @@ $var = '122.34343The';
|
|||
$float_value_of_var = floatval($var);
|
||||
echo $float_value_of_var; // 122.34343
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>floatval</function> non-numeric leftmost characters Example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$var = 'The122.34343';
|
||||
$float_value_of_var = floatval($var);
|
||||
echo $float_value_of_var; // 0
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
|
Loading…
Reference in a new issue