Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. Well, that's because you're urlencode'ing it. \W excludes digits as well, so if you want you can go back and replace \d with nothing again.
  2. If echo doesn't work it's probably because a fatal error is occurring before it. Check your error log or enable display_errors.
  3. That's because you're escaping them twice.
  4. SVN, git, mercurial, etc. Tools like the aforementioned are sometimes collectively called VCS (version control systems).
  5. Seems to work fine for me... What exactly do you want? What did you expect as output? The code does exactly what it says. It'll replace any non-word characters as defined by the tr_TR locale with nothing and then encode the entire URL.
  6. $text = urlencode(preg_replace('#\W#', '', $text)); http://php.net/manual/en/regexp.reference.backslash.php
  7. You can type hint non-scalar parameter types. It'll result in a run-time fatal error if a non-matching type is given. You could write an RFC at http://wiki.php.net (and send it to the internals list) to have what I believe Java calls automatic boxing and unboxing. This would allow you to pass e.g. primitives like ints to an SplInt without having to do new SplInt(42).
  8. I'd use preg_replace_callback. Check out the examples in the manual. It should be easy to see how you can use it for this.
  9. Regex #1 does this: Nothing at the start matches "anything", can I still do that? Yes, the 'a' matches, can I still match anything, yeah the 'b' does. It continues to do that all the way until: can I still match anything, yes, the 'i' matches. Then it finally checks, can I match 'i'? Nope, so I'll go back one step. Now can I match 'i'? Yes. Done. Regex #2 does this: Can I match anything 0 or more times? Yes, the nothing at the start matches that. Now does 'i' match? No, okay then I'll try matching .*? again which 'a' does. Now does 'i' match? Not yet, but 'b' matches. It does all that until it has matched 'h'. At that point 'i' matches, the regex has ended and the engine tells you there is a match.
  10. Set the correct locale using set_locale and use \W. Otherwise just specify the characters manually in your character class.
  11. You can use trigger_error to raise E_USER_* errors. Aside from that, you cannot use PHP's error handling system.
  12. You'd want to upgrade the memory at least. Seeing as it's so cheap, you might as well get 4 GB if your motherboard supports it.
  13. How does Windows manage to address a memory address above 2^32 with a 32-bit pointer? How does it manage to say "yo, your shit is at 0x400000FF8F" when it cannot even represent an integer so large?
  14. The bug has been fixed in SVN. I think it should be available in the next release of 5.2 and 5.3.
  15. You may still have issues with your web server buffering output. If you've turned something like gzip encoding on, the web server will buffer it regardless of your usage of flush().
  16. An easy way of doing it would be to expose an API on the servers and then fetch information from that file routinely. PHP.net does something similar for checking the status of their mirrors. If you go to something like http://dk.php.net/mirror-info you'll see that it gives various information. This is just downloaded once in a while and can then be seen from an admin panel listing all mirrors and their statuses. See this: http://svn.php.net/viewvc/web/php/trunk/mirror-info.php?view=markup You would want to cache the information locally if you have many mirrors though. This prevents you from having real time updates, however.
  17. Well, it already shows the URL in the status bar, and you can press 'o' to go to a new URL (or 't' to do it in a new tab). All the GUI elements that it hides by default can be shown again though.
  18. Does anyone else use the Vimperator addon for Firefox? I just discovered it yesterday and I love it. Vim in my browser = awesome. It's navigational features are brilliant. There are still some things I have to figure out, but so far it's been great. Anyone who is just a little proficient with Vim should try it out. You can even edit text fields using an external editor (Vim of course!) by using <C-i>.
  19. To get around that restriction, try searching for *a*. Your post probably contains an 'a'.
  20. Daniel0

    If It Exists

    You can also use REPLACE INTO ... or INSERT IGNORE INTO .... I'd use thorpe's suggestion, though I might do ON DUPLICATE KEY UPDATE firstname = firstname so it can optimize the update statement away.
  21. Expiring links, perhaps?
  22. I hate those people who scream "SKIP!!" into the mic. If I want to skip the level I'll click the damn vote button myself. Seeing as I haven't voted, I probably want to play that map so STFU. There should be some sort of law prohibiting children from owning microphones, or even better prohibit them from online gaming.
  23. You could try services like Akismet, which use various heuristics for detecting spam instead of trying to prevent it.
  24. I'm playing on PC with the name "Daniel". I have no need nor desire to be known as something like "iPwnYouPewPew42".
  25. It's probably humans filling out your form. Humans tend to pass a "Completely Automated Public Turing test to tell Computers and Humans Apart" (aka CAPTCHA).
×
×
  • 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.