Page 2 of 2

Posted: Wed Dec 11, 2002 1:34 am
by volka
while ($data = fgetcsv ($fp, 600, "~")); {
while(cond) ; { ... } unfortunatly does not produce a warning but it means: an empty loop-body followed by another code block (not related to the loop)

Posted: Wed Dec 11, 2002 1:38 am
by volka
print('<a href="who_are_you.php3?person=' . urlencode($person) . '">Back to Who Are You?</a>');
  • the parameter for print is divided into three parts
  • the single-quoted stringliteral '<a href="who_are_you.php3?person='
  • the function-call urlencode(...)
  • the single-quoted literal '">Back to Who Are You?</a>'
all three are concatenated to one string.

Code: Select all

<?php
$part1 = '<a href="who_are_you.php3?person=';
$part2 = urlencode($person);
$part3 = '">Back to Who Are You?</a>';
$concat = $part1 . $part2 . $part3;
print($concat);
?>

Posted: Wed Dec 11, 2002 9:44 am
by permutations
while(cond) ; { ... } unfortunatly does not produce a warning but it means: an empty loop-body followed by another code block (not related to the loop)
Oh my goodness--I see! One misplaced semi-colon. DUH!! I'm blind. Thank you!

Posted: Wed Dec 11, 2002 10:00 am
by permutations
Thank you! I see!! I was parsing it in my mind all wrong. I was looking at:
' . urlencode($person) . '
versus
'urlencode($person)'
I didn't realize that the single quotes went with strings on either side, and not the urlencode call. What confused me was the double quotation marks within the single-quoted literals. I thought they were defining a string. I understand now that they are not.

You have explained so many things that have puzzled me. I'm very grateful.