Hello guys. I’m dipping my toe in php as part of my wordpress learning experience. I had akimmed through some tutorials here and there and the basic is kind of OK as I have some basic knowledge of other programming language. There is one thing though that I’m not too sure about, and I thought you guys can enlighten me: what’s the difference (and meaning) of [php]->[/php] and [php]=>[/php]?
Let’s look at some examples:
[php]< ?php
$my_divs = get_post_meta($post->ID, ‘my_divs’); // Get the field data
foreach ($my_divs as $my_div => $name) // loop through each add_more
{
get_template_part(‘custom-div’, $name); // display the template
}
?>[/php]
Here we have both. what’s the meaning of [php]$post->ID[/php]?
And what’s the meaning of [php]$my_div => $name[/php]? what’s the difference?
thanks