-
Posts
1,832 -
Joined
-
Last visited
-
Days Won
3
Everything posted by salathe
-
Hi Michael, welcome back. PHP has changed loads over the years, best of luck getting reacquainted.
-
http://planet-php.net/
-
The mbstring regex functions are only similar by name. They use the Oniguruma regex engine to get the work done, not POSIX nor PCRE. Only the POSIX family of functions are deprecated at this time.
-
No, the mbstring regex functions are not deprecated.
-
Do this, please.
-
Spot the difference: if(in_array(strtolower($info['extension'])), $extensions) - original if(in_array(strtolower($info['extension']), $extensions)) - fixed As for getting the right array or JSON, the replies above should help you out. Also, are all of the files in one folder? The guys above aren't sure whether you need to get files from one directory, several directories, or any level of directories.
-
Stealing badges is a bannable offence, and we'd confiscate the cake if it happened. Sorry. Back on topic, please.
-
I'm not entirely sure we did.
-
You have date("m/d/y g:i A",($row['date'])). The second argument to date is expected to be an integer containing the Unix timestamp for the date and time you want to format. You're most likely passing it an already formatted date string. Depending on the format of this date string, it might be sufficient to simply use strtotime to convert it into a Unix timestamp before re-formatting with date. date('m/d/y g:i A', strtotime($row['date'])) However, strtotime cannot make sense of every possible date/time string. If the above does not work, show us the value for $row['date'] as there are other alternatives available for when strtotime does not work.
-
How to sort data without javascript while Php scraping
salathe replied to Nuv's topic in PHP Coding Help
I went to the URL in the first post, opened Chrome's Developer Tools, clicked to the Network tab. Then, clicked the header in the table and looked for the address of the page requested by JavaScript. -
get date from specific keys in associative array
salathe replied to russthebarber's topic in PHP Coding Help
You can loop over the array's keys by using something like foreach(array_keys($priceArr) as $date), then inside the loop do whatever checking you need and build the date array. For example: $dateArr = array(); foreach (array_keys($priceArr) as $date) { $datetime = new DateTime($date); if ($datetime->format('F') == 'September') { $dateArr[] = $datetime->format('j'); } } -
The parenthetical remark is incorrect, is_null is a perfectly normal function and not a language construct.
-
How to sort data without javascript while Php scraping
salathe replied to Nuv's topic in PHP Coding Help
http://www.google.de/products/catalog?hl=de&q=4242002690209&cid=2594634728159287170&cpo=1&scoring=tps Also, the cpo=1 can be removed to get a full page. -
Very little discussion happend for this particular RFC, so whether it has a good chance of being introduced or not is up in the air. That said, the lack of discussion is telling; useful things usually get more chatter. Not yet, and this particular horse has been running for some time. Comments on the idea are positive, with very few dissenting voices. There have been lots of minor tweaks as particular implementation details get hammered out. The outlook is positive for this one, but no vote has been held nor any code committed. I may have to bear the brunt of your scoffing, but will continue to use global regularly. So long as @global is made to work, I'd accept your suggestion.
-
Where did PHP borrow the idea of Trait from?
salathe replied to Hall of Famer's topic in Miscellaneous
https://wiki.php.net/rfc/horizontalreuse#links_and_literature -
Oh really? Ya really. 1zeus1, what have you tried so far?
-
Good work on reading it, really. I guess you totally failed to see my point, which was that .josh "couldn't imagine" something that was very clearly asked for in the first post. Did you think I was trying to say .josh said something wrong?
-
I think they're going to laugh at you from behind their nice, dry stacks of money that you gave to them.
-
Try re-reading the first post.
-
str_replace() does not replace based on a regular expression, you're looking for preg_replace().
-
You're getting there. And trying to answer questions is a great way of learning! Every day is a school day.
-
Why not access them directly? The OP seemed to have no problem with knowing what (the element names) he wanted to get information from. Anyway, you already know how to get values from the child elements whose names you don't know (like the gauges).
-
In this case, that's not particularly useful at all as there is only one <FifteenMinute> element per gauge.