T
T
Troodi Larson2018-03-13 17:20:10
PHP
Troodi Larson, 2018-03-13 17:20:10

Why is information displayed on the screen without an output function?

<?
$ch = curl_init();
$request_headers = array();
$request_headers[] = 'apikey:helloworld';
curl_setopt($ch, CURLOPT_URL, 'https://api.ocr.space/Parse/Image');
curl_setopt($ch, CURLOPT_HTTPHEADER, $request_headers);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "isOverlayRequired=true&url=http://site.ru/test/captcha.jpg&language=eng");
$result = curl_exec($ch);  
curl_close($ch);
?>

The response is displayed in the browser. although there is no output function. What is it like? It is displayed, of course, on the line:
$result = curl_exec($ch);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maksim Fedorov, 2018-03-13
@troodi

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question