php ceil code example

Example 1: php string to uppwe

$lowercase = "this is lower case";
$uppercase = strtoupper($lowercase);

echo $uppercase;
// THIS IS LOWER CASE

Example 2: round up built in function php

echo ceil(0.5); //Prints 1

Example 3: php round up

//round up to nearest integer
echo(ceil(0.60) . "
"); //result 1

Example 4: floor ceil php

echo(floor(0.60) . "
"); // 0 echo(floor(0.40) . "
"); // 0 echo(floor(5) . "
"); // 5 echo(floor(5.1) . "
"); //5 echo(floor(-5.1) . "
"); // -6 echo(floor(-5.9)); // -6 echo(ceil(0.60) . "
"); // 1 echo(ceil(0.40) . "
"); // 1 echo(ceil(5) . "
"); // 5 echo(ceil(5.1) . "
"); // 6 echo(ceil(-5.1) . "
"); // -5 echo(ceil(-5.9)); // -5

Tags:

Misc Example