miércoles, 10 de mayo de 2017

PHP : Obtener la parte entera de un decimal - Get the integer part of a decimal

Encontrar la parte entera de un decimal con PHP es muy simple, solo hay que utilizar la función floor().

Finding the entire part of a decimal with PHP is very simple, just use the function floor().

veamos el ejemplo. Let's see the example: 


<?php

$div = (10/3);
$int = floor($div);
echo "La parte entera es: ".$int;

?>


No hay comentarios.:

Publicar un comentario