Re: [PHP] Evaluating strings...
Anthony J. Maske wrote: Hey, Thanks for the quick response on Retrieving parameters... This is another that has me stumped... if (trim($Line) = 'body') { That should be == basically that is trying to set trim($line) to be equal to 'body' which won't work (and you get an error message). == means compare the values. === means compare the values AND the types (eg make sure they are both integers or strings). -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Evaluating strings...
Got it... Thanks mucho! Anthony J. Maske [EMAIL PROTECTED] http://home.comcast.net/~ajmaske -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 10, 2007 9:03 PM To: Anthony J. Maske Cc: PHP General Subject: Re: [PHP] Evaluating strings... Anthony J. Maske wrote: Hey, Thanks for the quick response on Retrieving parameters... This is another that has me stumped... if (trim($Line) = 'body') { That should be == basically that is trying to set trim($line) to be equal to 'body' which won't work (and you get an error message). == means compare the values. === means compare the values AND the types (eg make sure they are both integers or strings). -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Evaluating strings...
Anthony J. Maske wrote: Hey, Thanks for the quick response on Retrieving parameters... This is another that has me stumped... if (trim($Line) = 'body') { $InBody = true; } elseif (trim($Line) = '/body') { $InBody = false; } $Line is a line from a html file, I'm trying to parse through it to ignore everything but the body section. When I run the above I get the following... Fatal error: Can't use function return value in write context in C:\wwwRoot\anthony.maske\cfr.php on line 43 If I do this... $Tag = trim($Line); if ($Tag = 'body') { This assigns 'body' to $Tag - see below. $InBody = true; } elseif ($Tag = '/body') { $InBody = false; } Why won't the later work? What am I missing in the first snip... Thanks again...! Anthony Another page for you to read: http://ca3.php.net/manual/en/language.operators.comparison.php You're confusing assignment and comparison. = is for assignment, you have to use == or === for comparison. Lori -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php