Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Array Problem

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Array Problem

Postby TheSam » Sat Mar 08, 2003 4:02 am

Hello!

I'm a PHP newbie, so excuse me if this question sounds stupid :D :

I have loaded a textfile into the second "slot" of an array, $content[1]. When I use:
print $content[1];
it only prints the beginning of the file. For example, when I have a long line of 'a's (aaaa etc.) it only prints the 10-15 first ones.

Thankful for some help,
TheSam
TheSam
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sat Mar 08, 2003 3:58 am

Postby pootergeist » Sat Mar 08, 2003 6:08 am

what syntax did you use to populate the array?

$content[1] = fread ($fd, filesize ($filename)); ?
pootergeist
New php-forum User
New php-forum User
 
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK

Postby TheSam » Sat Mar 08, 2003 6:43 am

I found the problem thanks to you, thanks :)

I used the syntax you typed but in my code the filesize was taken from another variable which loaded a shorter file.

I c & p : ed from another place but forgot to change that :)
TheSam
New php-forum User
New php-forum User
 
Posts: 2
Joined: Sat Mar 08, 2003 3:58 am


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.