Skip to content

Tag: php

Running async function in php

is it possible to create some php class which can run functions asynchronously? Here is what I have done so far: Here is how I want to call it: Answer Recent versions of pthreads support closures as members, making the code very simple: However, this is horrible, it’s hard to imagine any function that i…

Filter by date today Postgres and PHP

Currently new to Postgres and php Need help on getting current date total of trees to show I just need to count current trees on current date but can’t seem to make it work. Answer I don’t know if I understand what is the problem, but since you say “current date” I guess you are just m…

All combinations of r elements from given array php

Given an array such as the following I’m looking for a method to generate all possible combinations, with a minimum number of elements required in each combination r. (eg if r = 5 then it will return all possible combinations containing at least 5 elements) Answer A combination can be expressed as nCr =…

cURL redirect request to amazon s3 returns 400 code

Using PHP curl to fetch a release tag file from github. Github responds with a redirect header to S3 which cURL does follow. For example: Results in a 302 with a location header to s3 with various authentication details Following the redirect location header, Amazon responds with 400 Request specific response…

Back Navigation Caching – IE

When I am running web application on IE 11, getting warning message as below: DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337 Same question is posted in: Form/JavaScript not working on IE 11 with error DOM7011 How to re…