i use file_get_contents function to grab data from sites and store the data in database. it will be very inconvenient for me, if one day the script will start not working.
I know, that it can start not working, if they change the structure of site, but now i’m afraid, that maybe there are mechanisms to disable the working of this function, maybe from server?
i tried to find documentation about it, but can’t get, so maybe you will help me?
Thanks
Yes, it can be disabled from php.ini with
allow_url_fopenoption. You have other options such as CURL extension too.Note also that you will need to have openssl extension turned on from php.ini if you are going to use the
file_get_contentsfunction to read from a secure protocol.So in case
file_get_contentsis/gets disabled, you can go for CURL extension.