Re: [PHP] substr question...

2001-07-27 Thread Ryan Fischer

You wrote:
 I am trying to receive file names but can't quite figure out the
proper  substr to do it:

 jeff.dat
 jeffrey.dat
 chris.dat
 tom.dat

 I want to receive the name to the left of the .dat

 Jeff

$file = array(jeff.dat, jeffrey.dat, chris.dat, tom.dat);
for($i=0; $icount($file); $i++){
eregi(^(.*)\.dat$, $file[$i], $ary);
$filename = $ary[1];
// Do something with $filename
print $filenamebr\n;
}

HTH!  :)

--
 -Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/



-- 
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] substr question...

2001-07-26 Thread Unni

try

$filename=explode(., names);
echo $filename[0]

Jeff Lewis wrote:

 I am trying to receive file names but can't quite figure out the proper substr to do 
it:
 
 jeff.dat
 jeffrey.dat
 chris.dat
 tom.dat
 
 I want to receive the name to the left of the .dat
 
 Jeff
 


-- 
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] substr question...

2001-07-26 Thread Boget, Chris

 I am trying to receive file names but can't quite figure out 
 the proper substr to do it:
 jeff.dat
 jeffrey.dat
 chris.dat
 tom.dat
 I want to receive the name to the left of the .dat

$fileName = eregi_replace( \.dat, , $fullFileName );

Chris



Re: [PHP] substr question...

2001-07-26 Thread Jeff Lewis

RE: [PHP] substr question...I suppose that $tmpmember=substr($entry, 0,-4); will do 
the same? :)

Jeff
  - Original Message - 
  From: Boget, Chris 
  To: 'Jeff Lewis' ; [EMAIL PROTECTED] 
  Sent: Thursday, July 26, 2001 3:54 PM
  Subject: RE: [PHP] substr question...


   I am trying to receive file names but can't quite figure out 
   the proper substr to do it: 
   jeff.dat 
   jeffrey.dat 
   chris.dat 
   tom.dat 
   I want to receive the name to the left of the .dat 

  $fileName = eregi_replace( \.dat, , $fullFileName ); 

  Chris