Questions tagged as 'arquivo'

5
answers

How to get the name of the current file

Recently I had a problem identifying the current page. I was using __FILE__ to get the current file, and used substr() to get the string after the last occurrence of bars, it turns out that on some operating systems these bars w...
asked by 23.11.2015 / 19:02
5
answers

Optimize function to include classes also looking in sub-directories

I have the following function to include classes when we are trying to use a class that has not yet been defined: /** * Attempt to load undefined class * @param object $class_name object class name */ function __autoload($class_name) {...
asked by 16.01.2014 / 16:40
4
answers

How to merge multiple text files into one?

Does anyone know how to select all text files from the same directory and merge all of them into just one final text file? Example: In the X folder, I have the 1.txt, 2.txt, and 3.txt files. I need to merge the contents of all into just one t...
asked by 22.05.2014 / 16:15
2
answers

What is stream?

In both PHP and C #, languages that I have lately used in my day to day, I have come across a common term: Stream. Whenever I hear the word Stream , the first thing that comes to mind is YouTube, among other sites, which are often called "st...
asked by 08.08.2017 / 14:10
1
answer

What maximum size can a JSON file have?

I will give an example to explain my doubt: I need to retrieve image information from an API, this image bank returns JSON's with information of the images I need, in total there are 33 million images and I will request 100 in 100 thousand....
asked by 30.11.2017 / 17:31
3
answers

How to improve file write speed for a ClientDataSet?

I am doing the integration of a system with a banking file, and am having a problem in the process. I get a plain text file with approximately 1300Kb and about 5,500 lines from the credit card company. I'm reading this file and storing it in...
asked by 02.04.2014 / 22:27
2
answers

What is faster, access data in file or database?

In performance, which method is faster to recover data, 1) read a file (which will be generated only once with PHP) or 2) get this data from a database? This data will always be displayed on the page in question. So far I'm using a .json...
asked by 29.12.2014 / 18:39
2
answers

What is faster to read and edited, a database or a .txt?

It would be to store and rewrite only 1 INT digit, deleting one and typing another, on condition that when it reaches 5, go back pro 1, and go doing that loop every time someone accesses. Whenever someone accesses the page, the value would...
asked by 28.11.2016 / 04:38
3
answers

What is the difference between DirectoryIterator and FileSystemIterator?

In PHP, there is the class DirectoryIterator .   The DirectoryIterator class provides a simple interface for viewing the contents of filesystem directories. There is also FileSystemIterator , which documentation only gives this descript...
asked by 30.09.2016 / 16:44
2
answers

How to count the number of characters of the word that came from the first line of a text file?

Below is an example of how to count the number of characters in a string: $palavra ="coisa"; echo strlen($palavra); //retorna o número 5 However, I'm getting this word from a text file and strlen is not working, see: $f = fopen("palavra...
asked by 24.08.2014 / 16:56