[eluser]rvillalon[/eluser]
Thanks, n0xie!
I also found example code in the cart library that's similar to what I wanted. Hopefully this will come in useful for someone in the future.
Code:
// Prep the quantity. It can only be a number. Duh...
$items['qty'] = trim(preg_replace('/([^0-9])/i', '', $items['qty']));
// Trim any leading zeros
$items['qty'] = trim(preg_replace('/(^[0]+)/i', '', $items['qty']));
// If the quantity is zero or blank there's nothing for us to do
if ( ! is_numeric($items['qty']) OR $items['qty'] == 0)
{
return FALSE;
}