Magento: Get cart total items, cart subtotal programmatically

In this article we get cart quantity. When we add to cart then how many product add to cart get quantity.
And how many total price of product get grand total.  

Here get cart total items......
$cartItem = Mage::getSingleton('checkout/cart')->getItemsCount(); 
echo $cartItem;

Here get cart subtotal......
$subTotal = $this->helper('checkout/cart')->getQuote()->getGrandTotal();
echo $subTotal;