I am trying to send a post request that does the excact same thing as the code below, but from a php file to another php file. In other words I want to make the post request with PHP and not Javascript. I have tried different methods but they all get the content from the php file, and not make the post like ajax.
$.ajax({
url: "./delete.php",
method: "POST",
data: {
id: 1
},
success: data => console.log(data),
error: err => console.log(err)
})