Header menu

_________________________________________________________________________________

Wednesday 2 April 2014

Pass parameter to post method of file_get_contents()


If you are looking for some alternative to php cURL then file_get_contents is the function you are looking for. File_get_contents() is the  way to read the contents of a file into a string. We are going to discuss this function  as simple one to request data from server and then with post method to parameters requesting for some specific content. It is same as like CURL requesting server/service for some data.

In simplest form we can just pass url to function to get content of webpage:


To do more you can pass parameter as string to post method



At last passing array as parameter to post method of file_get_contents()

No comments:

Post a Comment