Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
PHP is a widely-used, general-purpose scripting language that is especially suited for web development.
3
votes
Identifying most recent blogXX.php file
*.php") ; . The wildcard is used just after the interrogation point because, as stated in the documentation :
The ? … matches 1 of any character except a /
The * matches 0 or more of any character except a /
It means that you will get all files beginning by blog and ending by .php that have 1 character after blog …
2
votes
Upload image from Remote Server using URL
Switch
I'll focus on the following switch, because there's way to do way easier :
switch ($type) {
case 'jpeg':
$image_create_func = 'ImageCreateFromJPEG';
$i …
15
votes
Math quiz in PHP
That will require a bit more of processing in PHP, but nothing you can't do. …
2
votes
Accepted
Adjacency list with array data
Miscellaneous
The only thing that I could think of as general principle, since the code is pretty good, is that you don't test your inputs. What if the input array is empty ? What if the id does not …
1
vote
Getting the HTTP client's IP
Here's what I would change :
The answer to the question (see 200_success comment) states that the only thing that is hard to spoof is REMOTE_ADDR, so you should put this value first in your array.
…
3
votes
Rendering nested array in a <ol> with headings
I'll add to @mdfst13's answer that you should use concatenation when you want to display your strings. I get the idea that you want to separate things, but really, 3 lines to display a list item ?
O …
3
votes
Accepted
PHP session_set_saver_handler with session timeout
One last thing that I'm a bit unsure about (I know it works for C, don't remember for PHP), you could regroup the two conditions if($this->database->execute()) and if($this->database->rowCount() > 0) into … Once again, this is something I know works in C, not quite sure about PHP.
How it works
You said you had a constant redirection loop with a previous version of your code. …
8
votes
Accepted
Mission impossible: beat everyone else to the queue
I don't really see the point to create with PHP a file that then you have to read in javascript. … Two other (minor) things :
I would execute the analysis of the HTML on the PHP side, there are great functions to do so. …