Code:<th class="th-6 sectiontableheader">' . ($show_replies) ? 'Replies' : 'Views' . '</th></tr>';
Code:1. Move the first letter of the message up the alphabet by the first value of the key. 2.Move the second letter of the message up the alphabet by the second value of the key.
Code:With Jordan away on vacation, I decided to fulfill my role as an administrator and fix a bug one of our members pointed out. One the homepage, rather than showing the number of "Replies" it showed the number of "Views." Jordan originally wrote the code for the tabs, but while trying to debug it, I realized how much more elegant the ternary operator is. Most operators are binary because they operate on two operands. The ternary operator thus operates on three operands – and it makes excerpts of code look much nicer. An excerpt of Jordan's original code is blow:Using the ternary operator, it reduces to one line.Code:if ($show_reply == 0) { $html= $html . "$views"; } else { $html= $html . "$replycount"; }Its really simple: (condition) ? (case_one) : (case_two);Code:$html = ($show_reply) ? $html . $replycount : $html . $views;
Code:myArray = new Array(3); myArray[0] = "Item 0"; myArray[1] = "Item 1"; myArray[2] = "Item 2"; for (i=0;i<myArray.length;i++) { document.write(myArray[i] + "<br />"); }
[code]http://i204.photobucket.com/albums/bb52/jwebmaster/rogers-1.jpg[/code[
Code:0eb4e14e3a0af58fa4769fdad43ec79f52abfcdb![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks