Maximum number using max() function

We can get maximum value or highest number between two variables or two numbers by using max function. We can use more than two numbers also. Here is the code.
echo max(5,25,6,-22,-66); // Output is 25 

Max with String

We can find out maximum by comparing one string wth a number. Here string will be treated as 0 and then compared.
echo max(-2.5,'plus2net'); // Output  plus2net
echo max(0,'plus2net'); // Output is 0, when values are equal the order decides the output 
echo max(3,'plus2net');  //Output is 3

Max with array

echo max(array(3,15,-5)); //Output is 15

Read More on max value of Array

Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here .

    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2022 All rights reserved worldwide Privacy Policy Disclaimer