Convert PHP Array to Integer?
Hi I was fiddling around with MySQL and PHP and I was getting an issue with arrays, this question doesn't require SQL knowledge, just stick with me for a moment. Here's the source code: ~ SQL Code you don't care about ~ $query_retrieve_max = some command that will retrieve the max index of my database; $query_retrieve_max_result = mysqli_query($con, $query_retrieve_max); <-- also uninteresting $max_id=mysqli_fetch_assoc($query_retrieve_max_result); <--- the database gets the maximum index (in my case 3) and saves it to the variable "max_id". printf_r($max_id); results into this: "Array ( [total] => 3 )" The issue is I can't use that variable for a for-loop for example (amazing, 3 for's in one sentence). The site loads infinitely and in my case runs the for loop endlessly (creates infinite divs). How can I convert that "Array" Value to an integer type so its usable with for-loops and stuff?