Skip to content
Advertisement

Tag: asynchronous

is `file_get_contents(“php://input”)` the only way to get post data from `fetch` and is it safe to use async- and hack-wise?

I’m trying to rewrite my JQuery $.post() code via native fetch() function. And it seems like the only way to do it with PHP server code is using file_get_contents(“php://input”). I do it like it is shown here and here: js code: myscript.php: There are two things which makes me worried: The project has more than one fetch call like this.

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 is so hungry that it requires

Advertisement