
Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
Personally, I wouldn't mind if PHP 6 broke backwards compatibility and got properly reorganized in a logical manner.
-
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.
-
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.
-
Analyzing a string as positive or negative
Daniel0 replied to JoeLongstreet's topic in Application Design
Not without determining the adjective beforehand. Otherwise it would require very sophisticated artificial intelligence. -
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.
-
You have to make sure that you're using UTF-8 or Big5 as your character set.
-
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.
-
VALUES ($userName','$race' Notice anything wrong?
-
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 }
-
[SOLVED] Problems loading files with GET data in path
Daniel0 replied to Mzor's topic in PHP Coding Help
Could you show us the code? -
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.
-
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.
-
For what? It isn't in the manual. http://dk2.php.net/manual/en/language.types.string.php#language.types.string.syntax.double
-
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?
-
Use a combination of strlen, if statements and substr.
-
[SOLVED] do I need to be using mysql_free_result
Daniel0 replied to pernest's topic in PHP Coding Help
PHP's garbage collection should be able to figure out that you are no longer using the resource when the variable is overwritten. -
That would actually be really cool. Like an alias that is substituted to the real one during the preprocessing of the post.
-
This should be a fairly straightforward change. I'll see what I can do.
-
How is it password protected?
-
Use the DirectoryIterator to get the contents of a folder and use the GD library plus some simple math to generate a thumbnail.
-
Any reason why you don't use htmlentities?
-
You can. PS: MS Paint blows. [attachment deleted by admin]
-
Post count is not entirely removed. It's just hidden from the topic view for regular members.