Skip to content

Tag: file-get-contents

Get link by id API/URL

I have this code I want to get link by id. Can anyone help? Answer More ore less what you need could be: This will output: Desired link = http://46.105.112.116/?watch=TN/mbc3-ar&token=RED_cexVeBNZ8mioQnjmGiYNEg==,1643770076.5266113827&t=1&s=2&p=1&c=BR&r=1351&lb=1 If you prefer, &#8…

Get an array in a php file from http request

I’m learning php and I’m trying to get a php file from a http request using Guzzle and then just take a particular array from those contents and ignore the rest. But I’m unsure how to get that array. When I print $contents it looks as expected, for example: I want to just get the array, iter…

PHP file_get_contents booking.com Site

I try to get a booking.com page from a hotel to fetch the prices afterwards with regex. The problem is the following: I call file_get_contents with parameter like checkin and checkout (file_get_contents(“/hotel/at/myhotel.html?checkin=2017-10-12&checkout=2017-10-13”)) dates so that the prices …

php try catch not working properly

I have code like this: and problem is that, when file_get_contents can not read url (may be site not responding or something like this..) my code writes error: failed to open stream: HTTP request failed! and execution goes direct to finally block bypass catch block without entering in it.. any ideas? Answer Y…