what is this "$" sign in echo $row ?
Moderators: egami, macek, gesf
- simplypixie
- php-forum Active User
- Posts: 300
- Joined: Sun Dec 11, 2011 12:51 am
- Location: Shrewsbury, Shropshire
- Contact:
Dollar Sign - it doesn't have a special name.
However, if you mean what does it represent in PHP then it is always required to indicate a variable.
However, if you mean what does it represent in PHP then it is always required to indicate a variable.
- simplypixie
- php-forum Active User
- Posts: 300
- Joined: Sun Dec 11, 2011 12:51 am
- Location: Shrewsbury, Shropshire
- Contact:
Yes
- simplypixie
- php-forum Active User
- Posts: 300
- Joined: Sun Dec 11, 2011 12:51 am
- Location: Shrewsbury, Shropshire
- Contact:
No it is not a special name, it is just used a lot when looping through arrays, for example
However you could also use any name you like
Code: Select all
while ($row = mysql_fetch_array($result)) {
echo $row['id'];
}
Code: Select all
while ($sausage = mysql_fetch_array($result)) {
echo $sausage['id'];
}
- simplypixie
- php-forum Active User
- Posts: 300
- Joined: Sun Dec 11, 2011 12:51 am
- Location: Shrewsbury, Shropshire
- Contact:
Sorry I don't know what your question is. However, I would learn HTML first and then move to PHP they are 2 very different coding languages and you may just confuse yourself trying to learn both at the same time.
-
- php-forum Fan User
- Posts: 973
- Joined: Mon Oct 01, 2012 12:32 pm
the dollar sign designator bypasses a lot of the issues you have in other languages with reserved words. The only place where you could really screw something up by using a reserved word would be with function and class names, since the identifiers are not prefixed with the dollar sign. The number of words you could cause issues with is fairly limited though and pretty common sense. If you're trying to declare new function if() for example, it won't work as intended and you'll get fatal errors.