API tutorial for Beginners step by step - 7 - how to consume API with PHP

preview_player
Показать описание
Question 1:

At first you should check ini setting allow_url_fopen, AFAIK this is the only reason why file_get_contents() shouldn't work. Also deprecated safe_mode may cause this.

Question 2:

Yes, you can build almost any cURL request with sockets.

My personal opinion is that you should stick with cURL because:

timeout settings
handles all possible HTTP states
easy and detailed configuration (there is no need for detailed knowledge of HTTP headers)
Рекомендации по теме
Комментарии
Автор

Hi Tutor
I get illegal string offset 'title' when i try to run the code above . The error comes from <?php echo $post['title']; ?>

bernardchisumo
visit shbcf.ru