When should you use PHP(cURL) over JavaScript (Axios, Ajax, Fetch)

Viewed 203

If I need to interact with a web API for making HTTP requests like POST and GET, would a javascript program be a better option or a PHP one?

1 Answers

It's totally based on your choice. Javascript is a client side language and PHP is a server side language. If you look for your page not to load for an API call, front end frameworks like Angular can help performing crud operations with a good user experience. In case you wish to use PHP, you can simply use JavaScript (Ajax), which again is a good choice for user experience to call a server side script (PHP), and then perform crud operations from there.

Related