mirror of
https://github.com/TheAlgorithms/PHP.git
synced 2025-07-10 03:26:19 +02:00
13 lines
288 B
PHP
13 lines
288 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;
|
|
}
|