[PHP] Can anyone help me out? I am really getting frustrated!

2002-08-15 Thread Mike

Hello all,
I am very confused. This script that I have been working on for a while
is giving me a hard time...

$string = Current song: 01. DJ Nightflight - The first flight (original
\
mix) (D I G I T A L L Y - I M P O R T E D - European Trance, Techno,
Hi-\
NRG... we can't define it!);

if(substr($string,0,1) = C){
print made it past substr!br\n;
$TrackName = trim(substr($string,strpos($string,.)+1));
}
The problem is that it never gets past the substr in the if(...)
statement, therefore never setting $TrackName.

I am really lost on what to do, any help would be appreciated.

Thank You,
Mike
[EMAIL PROTECTED]
[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Can anyone help me out? I am really getting frustrated!

2002-08-15 Thread Matt Schroebel



 -Original Message-
 From: Mike [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, August 15, 2002 2:46 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Can anyone help me out? I am really getting frustrated!
 
 
 Hello all,
 I am very confused. This script that I have been working on 
 for a while
 is giving me a hard time...
 
 $string = Current song: 01. DJ Nightflight - The first 
 flight (original
 \
 mix) (D I G I T A L L Y - I M P O R T E D - European Trance, Techno,
 Hi-\
 NRG... we can't define it!);
 
 if(substr($string,0,1) = C){

You're assigning, not comparing here.
Should be:
  if(substr($string,0,1) == C){

If you write these like this:
  if(C = substr($string,0,1)) {

Php will give a parse error because you can't assign a value to a constant.

   print made it past substr!br\n;
   $TrackName = trim(substr($string,strpos($string,.)+1));
 }
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Can anyone help me out? I am really getting frustrated!

2002-08-15 Thread Mike

There were 2 equal signs, when I sent It outlook must have made them
into one.
Mike

-Original Message-
From: Matt Schroebel [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 15, 2002 2:48 PM
To: 'Mike'; [EMAIL PROTECTED]
Subject: RE: [PHP] Can anyone help me out? I am really getting
frustrated!



 -Original Message-
 From: Mike [mailto:[EMAIL PROTECTED]] 
 Sent: Thursday, August 15, 2002 2:46 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Can anyone help me out? I am really getting frustrated!
 
 
 Hello all,
 I am very confused. This script that I have been working on 
 for a while
 is giving me a hard time...
 
 $string = Current song: 01. DJ Nightflight - The first 
 flight (original
 \
 mix) (D I G I T A L L Y - I M P O R T E D - European Trance, Techno,
 Hi-\
 NRG... we can't define it!);
 
 if(substr($string,0,1) = C){

You're assigning, not comparing here.
Should be:
  if(substr($string,0,1) == C){

If you write these like this:
  if(C = substr($string,0,1)) {

Php will give a parse error because you can't assign a value to a
constant.

   print made it past substr!br\n;
   $TrackName = trim(substr($string,strpos($string,.)+1));
 }
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php