Ok this isn't specific to this topic but you've brought it up here and it's a chance for me to learn a bit more about programming. When you put:
Code:
$class = ($i == 1) ? "class=\"first\"" : "class=\"default\";
Does that code translate to : Does i = 1? If it does put class = first, if it doesn't put class = default. Is it just a quicker way of saying :
Code:
if ($i == 1) {
class=\"first\";
}
else {
class=\"default\";
}
I've seen this in other languages as well such as JavaScript, is it the same in both?
Bookmarks