Jump to content

DarkWater

Members
  • Posts

    6,173
  • Joined

  • Last visited

    Never

Everything posted by DarkWater

  1. $self should be $this.
  2. No problem. You can also set the timezone in your php.ini if you don't want to have to include that line in every page. If you do decide to do it like that though, I'd suggest throwing it in a general header file that you just include.
  3. And what does: date('m/d/Y', 1224468800); Yield? My guess is that it's your server, and strtotime() and date() would be the easiest and most efficient way to do this.
  4. I hope you realize how ridiculous that sounds, no offense. Anyway, you see what you're echoing the string before you str_replace() it? Hmm...
  5. When you work with a string literal like that in a boolean statement, it won't actually allocate more than the length that you actually provide. When you say "", it doesn't actually allocate any new space other than whatever data it has to give to the yylval in Flex and Bison. The thing is, you should use trim() regardless. Then you'd have: strlen(trim($name)) And two function calls are much heavier than 1.
  6. You could always use date_default_timezone_set('UTC') if you want GMT time.
  7. Yeah, wouldn't this just give you the exact same result? echo strtotime('10/20/2008');
  8. Umm...strtotime() would already give you a Unix time. Unless I'm completely misunderstanding your goal.
  9. Could you just use their user_id then? If it's auto-incrementing, it technically IS their "rank" if you're going by the order in which they joined.
  10. That should still work.
  11. @Guardian-Mage: Put the result of count() in a separate variable rather than calling it on every iteration. It's much faster doing something like this: $count = count($varArray); for($i=0;$i<$count;$i++) { } @jeff5656: Why do you have a table designed like that? That's pretty umm...unoptimized. I'd honestly suggest reading up on database normalization.
  12. Query: SELECT * FROM users ORDER BY join_date ASC; Code (sort of): //do query, results in $result $rank = 1; while ($row = mysql_fetch_assoc($result)) { //process stuff echo $rank; $rank++; }
  13. <?php echo strlen(trim(" ")) . "\n"; ?> Says 0 for me.
  14. The str_replace() is pretty useless because trim() would take care of it anyway.
  15. I think a better question is why are you making a thousand pages when you can just have a single PHP page that serves up the content? =/
  16. Just as a tip, you'd want to use trim() before checking so that someone doesn't enter only space characters.
  17. html_entity_decode()?
  18. Basically.
  19. 1. mysql_real_escape_string(); 2. htmlspecialchars() followed by nl2br(). The order is important.
  20. @cooldude: I wouldn't use GD for this. I'd suggest using cURL and retrieving just the headers (not the whole image) so that you can keep page load time to a minimum.
  21. Oh yeah, I did hear about that. My personal opinion is that the reason that people didn't feel responsible is exactly the same as the reason for bystander apathy in a murder or a robbery or something. Since people knew that tons of other people were watching, they felt less obligated to do something.
  22. Why are you doing array_push() to make an array of things that are already in an array? o_O
  23. My bad, I switched the strrchr() arguments. $ext = strrchr($_FILES['uploadedfile']['name'], '.');
  24. I'd suggest searching like, Sourceforge and seeing if anyone has written something to do this from the terminal.
  25. I actually don't think you can do it easily. Is there a way to convert Excel to PDF under normal circumstances? (I don't use Excel, so idk)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.