Created
July 17, 2022 07:42
-
-
Save smunchi/0f575cbcd1d7f859f19b21462b34305c to your computer and use it in GitHub Desktop.
get data with curl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function get_content($URL){ | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
| curl_setopt($ch, CURLOPT_URL, $URL); | |
| $data = curl_exec($ch); | |
| curl_close($ch); | |
| return $data; | |
| } | |
| print_r(get_content('https://abc.com/api/get-customers')); exit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment