PHP Online Compiler & Playground
HTML/CSS/JavaScript
HTML
CSS
Javascript
C++
C
PHP
Java
Python
Swift
C#
Ruby
Node.JS
Kotlin
jQuery
Go
R
TypeScript
Start PHP Course
Register
challenge::binary odd numbers
+10
Author: Freezemage
Dark
Public
Save
PHP
php
1
2
3
4
5
6
7
<?php
for
(
$i
=
0
;
$i
<
10000
;
$i
++)
{
$check
=
str_split
(
decbin
(
$i
));
if
(
array_sum
(
$check
)
%
2
!=
0
)
$result
[]
=
$i
;
}
print_r
(
$result
);
?>
Enter to Rename, Shift+Enter to Preview
OUTPUT