does it possible
Moderator: General Moderators
does it possible
i want to make a web of computers which having thumbs and prices and product name and no .my client is a lammer like me so i want to make it from the function include so he can edit the prices and product numbers by just editing notepad files by using include function .the problem is that web contain a lot of categories and a lot of products if i use include function for each one there are so many notepad files require all i need is can i use explode function with in include function so there is one file for each category and i can include its lines or coma seperated values to include?sory for poor english
- Jonah Bron
- DevNet Master
- Posts: 2764
- Joined: Thu Mar 15, 2007 6:28 pm
- Location: Redding, California
Re: does it possible
Yes, you can use explode() on it. But you won't use include, you'd use file().
http://php.net/file
File() loads the file, and splits it into an array at each line.
http://php.net/file
File() loads the file, and splits it into an array at each line.
Re: does it possible
$file = explode("\n", file_get_contents('txtfile.txt'));
echo $file[2];
echo $file[2];
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: does it possible
Or as Jonah said:mohsin360 wrote:$file = explode("\n", file_get_contents('txtfile.txt'));
echo $file[2];
Code: Select all
$lines = file('txtfile.txt');mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.