Intval () in php

0

I have a piece of code that is used in Datatables server side, and I do not know what this function is for, since it is inside the answer, but not in the library.

$output = array(
    "draw" =>         intval($_POST["draw"]),
    "recordsTotal" => get_all_data($cnn),
    "recordsFiltered" => $number_filter_row,
    "data" =>  $rst

);
    
asked by JhonyA98 28.07.2018 в 16:51
source

1 answer

1

It is a way of obtaining the integer value of a variable, and it makes the conversion with a base that can be specified or taken by default in which case it is base 10. The variable to be converted can be of different types.

int intval ($ var [ $ base])

More info here [ link .

You can see examples here [ link

    
answered by 28.07.2018 / 17:15
source