0

Who can help me to implemtent this algorithm in PHP language?

Algorithm : "Write an algorithm who displays the max of 5 integers entered by an user" I want to implement it in PHP language. i do it in Python correctly. here is my python code => https://drive.google.com/open?id=1EoIj3DZANvuLk0yVPaHgjegAF0KZomWV help to implement it in php. My english is not good! thx

25th Jan 2019, 9:23 PM
Murdet Pierre
Murdet Pierre - avatar
5 Answers
+ 1
Murdet Pierre, why you did not put your Python code in the Playground? It would be easier for us to see.
25th Jan 2019, 9:27 PM
Ulisses Cruz
Ulisses Cruz - avatar
26th Jan 2019, 1:13 AM
Murdet Pierre
Murdet Pierre - avatar
0
In PHP there is a function called 'max' that if you pass it an array of integers it will return the bigger. echo(max([2, 4, 1, 6, 3])) // => returns 6 https://www.w3schools.com/php/func_math_max.asp
26th Jan 2019, 10:49 AM
Ulisses Cruz
Ulisses Cruz - avatar
0
Thank you, It's really useful, this function max, but in fact, I wanted to understand how the loops work in php, I looked for algorithm examples that require a loop, and I implement it in python and PHP . Apparently, loops do not work the same way in all languages
26th Jan 2019, 1:15 PM
Murdet Pierre
Murdet Pierre - avatar
26th Jan 2019, 2:29 PM
Ulisses Cruz
Ulisses Cruz - avatar