Jump to content

PHP count() function


mongoose0031800

Recommended Posts

Hey all,

 

Why isn't my script outputting any value when I use the following code?

 

$item_count = count($_POST['qty']); die($item_count-1);

 

I've already tested that $_POST['qty'] isn't empty. If I output

count($_POST['qty'])

then it displays a value. But if I try to subtract a value of 1, no value comes out.

 

I swear I've seen people add/subtract values from a count function...am I wrong about this?

 

Thanks!

 

mongoose

Link to comment
https://forums.phpfreaks.com/topic/244706-php-count-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.