|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-11-16 12:55 UTC] carlos at vlcnet dot com dot br
Please, verify the script below,
this error occurred with others values in this variable too.
------------------------------------------------------------
<?php
function retorna_cnpj($cnpj)
$new_var = ereg_replace("[/\.\-\",$cnpj);
$new_var = settype($new_var,"integer");
return $new_var;
}
$w_cnpj = "12.345.678/0002-12"
echo retorna_cnpj($w_cnpj);
?>
------------------------------------------------------------
It must return 12345678000212 as integer, but
php return for me the number: 2147483647
Thanks
Carlos Portella
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 01:00:02 2025 UTC |
Please, verify the script below, this error occurred with others values in this variable too. ------------------------------------------------------------<?php function retorna_cnpj($cnpj) { $new_var = ereg_replace("[/\.\-]","",$cnpj); echo $new_var . "<br>"; $nada = settype($new_var,"integer"); echo $new_var . "<br>"; return $new_var; } $w_cnpj = "12.345.678/0002-12"; echo $w_cnpj . "<br>"; echo retorna_cnpj($w_cnpj) . "<br>"; ?> ------------------------------------------------------------ It must return 12345678000212 as integer, but php return for me the number: 2147483647 Thanks Carlos Portella