Most voted "file-get-contents" questions
This function is similar to `file()`, except that `file_get_contents()` returns the file in a string, starting from offset to maxlen bytes. In case of failure, `file_get_contents()` will return`FALSE`.
Learn more…34 questions
Sort by count of
-
9
votes2
answers19928
viewsDifference between file_get_contents and Curl ?
I wonder if there is any difference between using Curl and file_get_contents and which is safer ? Thank you in advance.
-
6
votes3
answers699
viewsSearch word with file_get_contents
How can I use file_get_contents to search for the word "team" on the site and if it locates the word echo in the word? <?php $content = file_get_contents( 'https://www.hostgator.com.br' ); $busca…
-
4
votes2
answers1388
viewsHow to save facebook profile photo in database?
I have a button that when you click, connects to facebook and displays the data of the person in a form for registration, in this form to a field of type text that returns to me the following:…
php facebook facebook-graph-api file-get-contents file-put-contentsasked 9 years, 7 months ago Soares 83 -
4
votes2
answers545
viewsProblems with the result Curl and file_get_contents
I’m trying to get an image from a website to use imagecreatefrompng(), but the backlash was never what I expected... Url:…
-
3
votes1
answer335
viewsHow to read the output from a file to a variable by passing POST parameters?
We can get the result of running a URL to a variable using the function file_get_contents(): <?php $pagina = file_get_contents('http://www.meusite.com/'); echo $pagina; ?> But how can we…
-
3
votes3
answers3638
viewsjson_decode returns null
I have a JSON file that is at that link. I need to take and display the data in PHP, I have the following code to test: $linkAnapro =…
-
2
votes1
answer135
viewsReading and writing problems
Assuming you have an access log, each request will create or include values in the log file. Simulating several requests via ajax, I found that there is always a problem. If you log into the browser…
-
2
votes1
answer871
viewsProblem with fopen
This file is performing its function perfectly, but it is returning some errors and I would like to be able to correct them. I need to know if I have to use the fopen and the file_get_contents…
-
2
votes2
answers1416
viewsBreak txt file into blocks, and each block into rows
I have an "active.txt" file where you can find information blocks Ex: SACOLAO CENTER R RUA PAULINO MENDES LIMA,31 CENTRO 45820440 EUNAPOLIS BA UNIQUE PISOS E REVESTIMENTOS R PAULINO MENDES LIMA,84…
-
2
votes2
answers4348
viewsSSL error with file_get_contents
When I try to open a url through file_get_contents, I’m having trouble when the page is https. I’m not talking about external pages, but in some libraries where the application’s own images are…
-
2
votes2
answers624
viewsphp cannot copy remote file, but download it from the browser
Hello. This file: http://www1.caixa.gov.br/lotteries/lotteries/lotteries/D_megase.zip I can download from the browser, but I can’t copy directly to my server using PHP. I have tried every possible…
-
2
votes1
answer204
viewsWhat function allows you to open . txt file and run other functions in the contents of this . txt?
Which C language function allows you to open file .txt and run other functions in the contents of this .txt?
-
2
votes2
answers1510
viewsfile_get_contents(): Content-type not specified assuming application/x-www-form-urlencoded
In this code I am creating to upload profile images to Imgur if (isset($_POST['uploadprofileimg'])) { $image = base64_encode(file_get_contents($_FILES['profileimg']['tmp_name'])); $options =…
-
2
votes3
answers67
viewsRegex is not working with file_get_contents
I have a problem about regex and I come here to ask you for help. I’m trying to get a file value .chr by regex, but it does not return any match, I find it strange because I have tested in regex…
-
1
votes2
answers777
viewsError installing Composer on Windows 7 64bit with Wampserver 2.5
I am trying to install Composer on W7 64bits. Using the Windows installer that the Composer website provides (Composer-Setup.exe). I have installed Wampserver 2.5 with php5.5.12 and Apache2.4.9.…
commiserate installation openssl windows-7 file-get-contentsasked 9 years, 7 months ago LeoFelipe 1,455 -
1
votes1
answer724
viewsIgnore http error code when using file_get_contents
I’m using file_get_contents to make a request to a url. This request can return an error 422. When that mistake 422 is returned, I need to capture the body, which comes in format JSON. But the…
-
1
votes1
answer72
viewsTaking hidden data with the <noscript> tag file_get_contents
I would like to retrieve a CAPTCHA information from one form and display it in another using the file_get_contents. It turns out that the page where the data is has the tag <noscript> that…
-
1
votes0
answers745
viewsPicking up content from a page with PHP
I’m taking all the contents of a page with the code: <?php $url = 'http://www.teste.com.br'; $dadosSite = file_get_contents($url); echo $dadosSite; ?> Works normally and was better than using…
-
1
votes1
answer590
viewsfile_get_contents is generating the error: "Too Many open files"
I have a script running on my server through Supervisord. This script queries the database for pending request processing, and when it does, sends the data of each request to an endpoint of a…
-
0
votes0
answers488
viewsCapture Page with PHP Curl
People need to capture the source code of a page with Curl, but the jQuery of this page that generates the content and Curl does not return this data generated with jQuery, is there any way to…
-
0
votes1
answer550
viewsProblems with file_get_contents and Domdocument
I’m trying to download the content of a site, but is giving this Warning: `Domdocument::loadHTML(): Unexpected end tag : tr in Entity And it’s spelling out several lines. I’m also not getting the…
-
0
votes0
answers360
viewsHow to capture website content and store in a database
Here the site that has the vacancies If you could just get in there and see how it works. I need to get the vacancy titles and the descriptions that contain in them as the: Company, Practice Area…
-
0
votes1
answer627
viewsSend POST file with php using file_get_contents
Is there any way to send a file via file_get_contents without manually manipulating the request header ?
-
0
votes0
answers416
viewsClass mPDF + file_get_contents
I have the following code to generate a PDF file and I want to use file_get_contents to include a chart and table that are generated dynamically on another page but the result is not as expected.…
-
0
votes1
answer50
viewsHow to fread() fetch data every 30 seconds without refreshing the page
I’m wanting that function fread() or file_get_contents() search for data in the file every 30s, but without refreshing the page, I tried and couldn’t get how to do it ?…
-
0
votes0
answers125
viewsPull information from another page
Through a certain url I receive the following code <script> window["ytInitialData"] = {"responseContext":{"serviceTrackingParams": [{"service":"GFEEDBACK","params":…
-
0
votes1
answer379
viewsGet Contents source code in Javascript
Hello, I am trying to use a javascript to read the source code of another page and write this content inside a div. <script type="text/javascript"> $.get('teste.php', function(data) {…
-
0
votes0
answers125
viewsIframe shows system on localhost - PHP
Good morning I’ll try to explain my situation and see if there’s a solution. I have a server that runs a java web application that I want to run only on localhost. Yet, on this server, I have a PHP…
-
-1
votes1
answer543
viewsDisplay contents of the <title> tag of the current page using PHP
Hello, I would like a help to modify the code below: <?php function page_title($url) { $fp = file_get_contents($url); if (!$fp) return null; $res =…
-
-1
votes2
answers383
viewsProblem with file_get_contents
I’m trying to fetch data from a process (TRF site) with file_get_contents and nothing comes. When I paste the url into the browser, it comes. I’ve tried thousands of examples I’ve found on the…
-
-1
votes1
answer154
viewsHow to turn content from a file into an array in PHP
I have a file that has a array with the translations of a website. The contents of the file are similar to this: var textHome = { "home": { "btn_contact": { "pt": "contato", "en": "contact", },…
php javascript array regex file-get-contentsasked 5 years, 2 months ago Thiago da Victória Nunes 59 -
-1
votes2
answers53
viewsView php file on the body of an email
I’m using Phpmailer to send emails, I want to encapsulate the content of a php page in the field: $mail->Body, this page that should be included in the body does search in the mail tracking api…
-
-2
votes1
answer215
viewsfile_get_contents
How to get the quotation value through the file get Contents of the following page: https://www.google.com/finance?q=USDBRL&ei=tb1KWOHWLMX_mAGJyLnIBw…
-
-2
votes1
answer64
viewsfile_get_contents Time PHP
Guys the following I have a file_get_contents in php, but this API sometimes goes off the air and it takes a long time to answer, it would be like for a time limit if past this time returns an…