I’ve got a table in MySQL lets just say for example its got two fields Username, GameName and Score. I want to calculate the rank of a user for an indivudal game name so I could do the query SELECT * …
Accessing deeper array keys using function arguments
I am trying to create a function (unless one already exists?) which is supposed to accept an “unlimited” amount of arguments (using func_get_args()) to find the value of an array key. Regardless of …
php change script while is running
I have a php script that I’m running from command line (e.g php test.php &). I would like to know if the execution is “flushed” automatically when I change some values in the script (using vim) while the script is running or if the script is somehow “cached” in the php engine when it starts running. Answer While the script
How to detect version of PHPUnit
I’m writing unit tests using an older version of PHPUnit (3.4) and thus can’t use all supported assertions listed in manual of 3.5 and 3.6. Though I could reengineer tests for instant support in my environment here, I’d like to make my tests dependent on current version of PHPUnit, so that it’s using assertsInstanceOf() as soon as my or any
Convert time in HH:MM:SS format to seconds only?
How to turn time in format HH:MM:SS into a flat seconds number? P.S. Time could be sometimes in format MM:SS only.
How can I detect the mime type with PHP when an actual file doesn’t exist?
Is there a way to detect the mime type of a file without actually having an actual file, for example when you’re generating the file and serving it as a download? I’m currently using file extension sniffing from here: http://www.php.net/manual/en/function.mime-content-type.php#87856 I was just wondering if there was another way short of actually creating the file on the server and using
scraping website for info when the URL has product id’s instead of true values
Im guessing its php cURL, but Whats the best way to make a loop to scrape the DOM for info from a webpage that uses id’s in the URL Query like (?ProductId=103) There is about 1200 pages. I need to find the innerHTML of the 9th span on each page. This info will just get stored in a mySQL table
Paginate WordPress $wpdb Query?
I have this query: I’m using this because Wordpress can’t properly order meta_values that uses numbers, anyway…everything works fine except I have no clue on how to paginate this using wp_pagenavi. Any idea? Answer Although I wouldn’t recommend it, you could try changing the properties of the global $wp_query object. You can look up the definition of the WP_Query class
PHP – Split code into multiple files or keep it in as few files as possible? [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 1 year ago. The community reviewed whether to reopen this question 7 months ago and left it closed: Original close reason(s) were not resolved Improve this question
Convert SVG image to PNG with PHP
I’m working on a web project that involves a dynamically generated map of the US coloring different states based on a set of data. This SVG file gives me a good blank map of the US and is very easy …