Array Problem

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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

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

User avatar
pootergeist
New php-forum User
New php-forum User
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK
Contact:

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

what syntax did you use to populate the array?

$content[1] = fread ($fd, filesize ($filename)); ?

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

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 :)


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron