mirror of
https://github.com/TheAlgorithms/PHP.git
synced 2025-01-17 23:28:14 +01:00
13 lines
271 B
PHP
13 lines
271 B
PHP
<?php
|
|
function isNumberNeon($input)
|
|
{
|
|
$inputSquare = $input * $input;
|
|
$inputArr = array_map('intval', str_split($inputSquare));
|
|
$sumOfSquareDigits =0;
|
|
foreach ($inputArr as $digit) {
|
|
$sumOfSquareDigits +=$digit;
|
|
}
|
|
return $sumOfSquareDigits ==$input;
|
|
}
|
|
?>
|