I have dates in the following format (yyyymmdd, 18751104, 19140722)… what’s the easiest way to convert it to date()…. or is using mktime() and substrings my best option…?
Is there some limit on a size of a file when causing a download with PHP?
Trying to force-download file with PHP using usual: And it does successfully for files somewhere below 32 mb. For bigger ones it just returns zeroed file. Obviously there’s some kind of limit, but what sets it? Using Apache 2.2.11 and PHP 5.3.0. Answer I eventually stumbled on this post: http://w-shadow…
How to write regular expression to match free email accounts?
I’m trying to write a regular expression that checks if an email form field contains a free email address, with no luck. Essentially I need to check if the email contains: hotmail, yahoo, gmail etc in the email field. Answer regex would be sth like: you can add all the other domains you want… does…
Get fragment (value after hash ‘#’) from a URL in php [closed]
How can i select the fragment after the ‘#’ symbol in my URL using PHP? The result that i want is “photo45”. This is an example URL: http://example.com/site/gallery/1#photo45
php removing item with period from array
I have a products array of widgets. Some widgets have the reserved period symbol in their names. The problem occurs when php meets the period, the rest of the widget name is disregarded. How could I …
Return an array from mysqli stmt query
I’m trying to convert a site to use prepared mysql statements, however I’m having some trouble replacing my use of fetch_array(). The comments on php.net offer a solution which I would have thought should work but for some reason I’m getting strange undefined constant errors when calling a f…
Create a folder if it doesn’t already exist
I’ve run into a few cases with WordPress installs with Bluehost where I’ve encountered errors with my WordPress theme because the uploads folder wp-content/uploads was not present. Apparently the Bluehost cPanel WordPress installer does not create this folder, though HostGator does. So I need to a…
Does a PHP exception stop execution?
check_for_safe_input($arg)) { throw new Exception(“Hacking Attempt”); } do_some_database_stuff($arg);…
Remove zero values from a PHP array
I have a normal array like this Array ( [0] => 0 [1] => 150 [2] => 0 [3] => 100 [4] => 0 [5] => 100 [6] => 0 [7] => 100 [8] => 50 [9]…
PHP – lookup array contents with dot syntax [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 7 years ago. Improve this question Does anybody see anything wrong with the following function? (Edit: no, I don’t think …