Skip to content
Advertisement

Php random odd or even [closed]

I want him to randomly pick 5 numbers from the string I entered and check them to see if they’re even or odd This is the code I made but I don’t want 0 included:

JavaScript

Advertisement

Answer

Try this:

JavaScript

Output will look smth like this:

JavaScript

And if you want number to appear only once:

JavaScript

Which will print allways unique values, like: Array

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement