[PHP] Re: Something wrong with the file() command.

2001-12-03 Thread Fred

When you attempt to print or echo an array the result is simply array.
You have to iterate through the elements of the array to see what each
element contains.  Read the array chapter in the manual for more
information.

Fred

Jose [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I try to give it a value with a var, but it doesn't work.

 The code is something like this.

 $y=str_pad($y,5,.txt); \\ To give it a filename from a var that contains
 only 1 number (with 1 digit)
 If in this step I do a echo $y, it shows the correct string. Suposing it
is
 2, it shows 2.txt

 $temp[]=file($y); \\ To load the file into the array.

 But after the file nothing happens, the array only contains Array.

 Sorry for my bad english.
 Jose.

 Olinet S.L.





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: Something wrong with the file() command.

2001-12-03 Thread Valentin V. Petruchek

Try this:
?php
echo pre;
print_r ($temp);
echo /pre;
?
and look for $temp content.

Zliy Pes http://zliypes.com.ua

- Original Message -
From: Fred [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, December 03, 2001 7:58 PM
Subject: [PHP] Re: Something wrong with the file() command.


 When you attempt to print or echo an array the result is simply array.
 You have to iterate through the elements of the array to see what each
 element contains.  Read the array chapter in the manual for more
 information.

 Fred

 Jose [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I try to give it a value with a var, but it doesn't work.
 
  The code is something like this.
 
  $y=str_pad($y,5,.txt); \\ To give it a filename from a var that
contains
  only 1 number (with 1 digit)
  If in this step I do a echo $y, it shows the correct string. Suposing
it
 is
  2, it shows 2.txt
 
  $temp[]=file($y); \\ To load the file into the array.
 
  But after the file nothing happens, the array only contains Array.
 
  Sorry for my bad english.
  Jose.
 
  Olinet S.L.
 
 



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re[2]: [PHP] Re: Something wrong with the file() command.

2001-12-03 Thread faeton

Hello Valentin,

Hehe, Valentin. Send my regards to beloved Zaporozhye and it's ppl :)
Haven't been there for ages. Eh...

VVP Try this:
VVP ?php
VVP echo pre;
VVP print_r ($temp);
VVP echo /pre;
?
VVP and look for $temp content.


--
Ivan 'Faeton aka xetrix' Danishevsky
ICQ(240266) [EMAIL PROTECTED] www.xemi.info


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]