Thursday, November 13, 2008

really, would it be that hard?

if($post.num_comments == 1)
< a href="comments_page.html"> $post.num_comments comment </a>
< a href="comments_page.html"> $post.num_comments comments </a>

or some crap like that.


Robby Ramdin said...

in java etc I would do:

System.out.println(numComments + "comment" + (numComments == 1 ? "" : "s"));

I like it because it concisely puts it on one line. I don't know if PHP has the same syntax. I don't really know if that was actually PHP I was looking at.

Chris said...

I don't know why it bothers me so much, but I'm going to comment so that it doesn't say "1 comments" any longer

Robby Ramdin said...

oh haha i didn't even notice it did that. i also thought nate was posting. lol