Home » Php » how to get value of int with ob_get_contents();

how to get value of int with ob_get_contents();

Posted by: admin September 16, 2018 Leave a comment

Questions:

i m trying to get the value of an integer from getcontent !

i ve seen this solution with string

ob_start(); //Start output buffer
echo "abc123";
$output = ob_get_contents(); //Grab output
ob_end_clean(); //Discard output buffer

get int value :

ob_start(); //Start output buffer
echo "<script> document.writeln(document.getElementById('idinput').value) </script>" ;
$output = ob_get_contents(); //Grab output
echo $output; //

converting this output with $var = (int)$output did not work either ! any help ?

Answers: