Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. Personally, I wouldn't mind if PHP 6 broke backwards compatibility and got properly reorganized in a logical manner.
  2. Because pop and push operates on a stack, i.e. in a LIFO like manner. The function you're looking for is called array_splice.
  3. You'll have to clarify that. URL routing just means routing a particular URL to a particular resource. Here you go: if ($_GET['page'] == 'register') { require 'register.php'; } There is no particular way you might want to do it. It really depends on your needs and how it needs to fit into the rest of your application.
  4. 1) The readfile should just be: readfile($uploaddir . $PDFtoview); 2) It'll not work with all the HTML stuff below.
  5. Not without determining the adjective beforehand. Otherwise it would require very sophisticated artificial intelligence.
  6. That would depend on how you implemented the suggested plural \s escape sequence. There is not following anything that can be interpreted as an integer, so you could do two things: 1) ignore it and return verbatim, or 2) remove the \s. Because PHP is eagerly evaluated, argument parameters are evaluated before they are passed on to the functions. Therefore, substitutions in a double quoted string would be done before preg_match() even gets to take a look at it. If you wanted the PCRE \s you would have to either 1) use a single quoted string, or 2) escape the escape sequence.
  7. You have to make sure that you're using UTF-8 or Big5 as your character set.
  8. You can use a trigger. Look it up in the MySQL manual. You can also just use the same user table for all your forums. That might be difficult depending on how it's coded.
  9. VALUES ($userName','$race' Notice anything wrong?
  10. Why are you writing a file like that for all of them? Why not do like this instead? if ($hasPicture) { // output it, or show an <img> to it } else { // generate one }
  11. Could you show us the code?
  12. Whale crazy.
  13. Yeah, that's what I'm saying. It wouldn't result in any ambiguity because the parsing rules already dictate what would happen if \s was a valid escape sequence for double quoted strings.
  14. Well, I know it's used for regex, but I don't see how that has anything to do with regular strings. The dollar sign also has special meaning in PCRE even though it's also used for variables. The string is parsed before it's passed to functions, so there would be no ambiguity. For instance, these will be parsed differently, but will do the same thing anyways: preg_replace('#\n#', '', $str); // vs preg_replace("#\n#", '', $str); I don't think the suggested feature is a good idea though.
  15. For what? It isn't in the manual. http://dk2.php.net/manual/en/language.types.string.php#language.types.string.syntax.double
  16. Seems like a lot of work and extra overhead for a minor convenience feature. Anyways, if you want it in PHP then why not propose it on internals?
  17. Use a combination of strlen, if statements and substr.
  18. PHP's garbage collection should be able to figure out that you are no longer using the resource when the variable is overwritten.
  19. That would actually be really cool. Like an alias that is substituted to the real one during the preprocessing of the post.
  20. This should be a fairly straightforward change. I'll see what I can do.
  21. How is it password protected?
  22. Use the DirectoryIterator to get the contents of a folder and use the GD library plus some simple math to generate a thumbnail.
  23. Any reason why you don't use htmlentities?
  24. You can. PS: MS Paint blows. [attachment deleted by admin]
  25. Post count is not entirely removed. It's just hidden from the topic view for regular members.
×
×
  • 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.