Last active
May 2, 2024 18:54
-
-
Save utilmind/dd61906e9f2bb2d58a56008fbc7a7960 to your computer and use it in GitHub Desktop.
is_scientific_notation in PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check, whether string is a numerical value in “scientific notation” format. | |
function is_scientific_notation($str) { | |
return !is_int($str) && !is_float($str) && is_numeric($str) | |
&& stripos($str, 'e') !== false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment