php - Getting resulting data from website query -
I need to get the resulting data from a website query. For example
The resulting page shows
login name
AEBP1_HUMAN
I need a result, in this case "AEBP 1_Himan" appearing on my website for. How to get it in confusion Thanks
The goal is, that you have the content of any url to a file As read, because php supports wrappers for various types of protocols.
The first example uses the function that reads the whole content and divides it into rows in an array.
& lt ;? Php $ content = file ($ url); Echo $ content [1]; ? & Gt; In the second example, you get the entire contents in the form of a string, so you have to divide it by the function till the end of the line.
& lt; Php $ Content = file_get_contents ($ url); $ Rows = explosion ("\ n", $ content); Echo per line [1]; ? & Gt; The third example uses the standard file combined with the function payouts that read the content line from the line.
& lt ;? Php $ fp = fopen ($ url); $ Fp = fopen ($ url, 'r'); $ Line = fgets ($ fp); $ Line = fgets ($ fp); Echo $ line; ? & Gt; The last example shows the use of curls do not forget to use the correct option.
& lt ;? Php $ ch = curl_init ($ url); Curl_setopt ($ CH, CURLOPT_HEADER, 0); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, 1); $ Content = curl_exec ($ ch); $ Rows = explosion ("\ n", $ content); Echo per line [1]; ? & Gt; Sometimes you may encounter issues on public hosting, where remote content is not read.
Comments
Post a Comment