What is this syntax?
Posted: Thu Sep 24, 2009 11:26 am
Hi everybody,
A php newb here, with what I'm sure will seem like a ridiculously simple question but it's new to me so here goes. I've been a programmer for over 15 years, but I've never seen the following syntax in any other language. I don't really understand what it means.
Here is an example:
$x=$xmlDoc->getElementsByTagName('ARTIST');
Here's another:
$cd=($y->childNodes);
And another:
for ($i=0;$i<$cd->length;$i++)
That little bit that kind of looks like a cheap asciii attempt to make a rightwards pointing arrow, "->" what is that? Minus less than? It doesn't really make sense to me. I've checked dozens of online tutorials, websites, and fact sheets. Some use the syntax but none I've found actually explains it. They just present it and assume we know what it means. It's not that intuitive to me. I've worked in a lot of different languages in my career but none that uses this syntax. So it's not that intuitive to me. Maybe I'm just thick, or coming from a different angle than most. SQL Server, Javascript, VB. Never been much up on the C derivitivs. Maybe it's used there, but not in anything I've worked in.
Any help, greatly appreciated.
Thanks,
Phil
A php newb here, with what I'm sure will seem like a ridiculously simple question but it's new to me so here goes. I've been a programmer for over 15 years, but I've never seen the following syntax in any other language. I don't really understand what it means.
Here is an example:
$x=$xmlDoc->getElementsByTagName('ARTIST');
Here's another:
$cd=($y->childNodes);
And another:
for ($i=0;$i<$cd->length;$i++)
That little bit that kind of looks like a cheap asciii attempt to make a rightwards pointing arrow, "->" what is that? Minus less than? It doesn't really make sense to me. I've checked dozens of online tutorials, websites, and fact sheets. Some use the syntax but none I've found actually explains it. They just present it and assume we know what it means. It's not that intuitive to me. I've worked in a lot of different languages in my career but none that uses this syntax. So it's not that intuitive to me. Maybe I'm just thick, or coming from a different angle than most. SQL Server, Javascript, VB. Never been much up on the C derivitivs. Maybe it's used there, but not in anything I've worked in.
Any help, greatly appreciated.
Thanks,
Phil