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)while ($data = fgetcsv ($fp, 600, "~")); {
php string variables embedded in HTML
Moderator: General Moderators
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>'
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);
?>-
permutations
- Forum Commoner
- Posts: 52
- Joined: Sat Dec 07, 2002 11:45 am
-
permutations
- Forum Commoner
- Posts: 52
- Joined: Sat Dec 07, 2002 11:45 am
Thank you! I see!! I was parsing it in my mind all wrong. I was looking at:
You have explained so many things that have puzzled me. I'm very grateful.
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.'urlencode($person)'
You have explained so many things that have puzzled me. I'm very grateful.