What does the [0] Argument/Index Use for?
Trying to improve my PHP knowledge through test and try! I am confused on [0] arguments at following WordPress PHP code
global $post;
$custom = get_post_custom($post->ID);
$price = $custom['price'][0];
$coMake = $custom['coMake'][0];
echo $custom['price'][0];
Are they for indexing/referencing inputs on the page? if so why they are same?! can you please let me know why and when to use them?
Trying to improve my PHP knowledge through test and try! I am confused on [0] arguments at following WordPress PHP code
global $post;
$custom = get_post_custom($post->ID);
$price = $custom['price'][0];
$coMake = $custom['coMake'][0];
echo $custom['price'][0];
Are they for indexing/referencing inputs on the page? if so why they are same?! can you please let me know why and when to use them?
No comments:
Post a Comment