Skip to content
No frills - Tips & Tricks on Magento, Wordpress, CakePHP, Amazon EC2, Rackspace, DigitalOcean, Linode and more
  • About
  • Contact Us
  • Privacy Policy
  • Code Snippets

    1. Home>
    2. Code Snippets>
    3. Page 2

    Get the offset (index, array key) of an array in php

    • Post author:cliper
    • Post published:December 6, 2010
    • Post category:Blog
    • Post comments:0 Comments

    $fruits = array(0 => “apple”, 1 => “orange”, 2 => “lemon” ); foreach($fruits as $key => $fruit) { printf(“%s is in index %s”, $fruit, $key); }

    Continue ReadingGet the offset (index, array key) of an array in php
    • Go to the previous page
    • 1
    • 2

    Recent Comments

      Copyright - WordPress Theme by OceanWP