Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $url = 'https://myapiurl.com/api/search?token=xxxxxxxxxxxxxxxxxxxxxxx';
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
- curl_setopt($ch, CURLOPT_POSTFIELDS, array ("Image" = base64_encode(file_get_contents("gambar.jpg"), "Filter" = filternya));
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array(
- 'Content-Type: application/json',
- 'Content-Length: ' . strlen($data_string))
- );
- $result = curl_exec($ch);
- curl_close($ch);
- $json_result = json_decode($result, true);
- ?>
- <?php echo $json_result['title']; ?></strong></p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement