read file
How can i store lines data in array?
Its not working properly sometimes it just print 1st array or sometimes last. Code PHP Code:
|
Re: read file
By using dynamic arrays. This is the code I use in nearly all my plugins:
PHP Code:
|
Re: read file
Quote:
|
Re: read file
Easier for you doesn't mean more efficient. Not using dynamic array means that you must have a limited amount of space where you can store the lines. With dynamic arrays this space is, well, dynamic and you don't need to worry about anything failing.
It's really not complicated at all. You can use the code as is, but I suggest you use the array with a global variable. PHP Code:
|
Re: read file
Quote:
|
Re: read file
Quote:
|
Re: read file
1. You're using "parse" for no reason. See its documentation to understand what it does - https://amxx-bg.info/api/string/parse
2. In the for-loop, you're using "sizeof line" instead of "sizeof StoredData", so basically you're retrieving the size of an integer, which is always equal to 1. |
Re: read file
Quote:
|
Re: read file
How can i read separately for example;
StoreData1 and StoreDate2 by using this array method. File: file.ini PHP Code:
PHP Code:
|
Re: read file
I recommend you to use ini parser in this case.
|
All times are GMT -4. The time now is 08:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.