note 125281 added to language.types.string
| From: | greenbluemoonlight at gmail dot com | Date: | Tue, 18 Aug 2020 15:05:29 +0000 |
| Subject: | note 125281 added to language.types.string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-214986@lists.php.net to get a copy of this message | ||
<?php
\\Example # 10 Simple Syntax - Solution for the last "echo" line.
class people {
public $john = "John Smith";
public $jane = "Jane Smith";
public $robert = "Robert Paulsen";
public $smith = "Smith";
}
$people = new people();
echo "$people->john then said hello to $people->jane.".PHP_EOL;
echo "$people->john's wife greeted $people->robert.".PHP_EOL;
echo "$people->robert greeted the two $people->smiths";
\\Won't work
\\Outputs: Robert Paulsen greeted the two
/**Solution:**\
echo "$people->robert greeted the two $people->smith\x08s";
\\Will work
\\Outputs: Robert Paulsen greeted the two Smiths
?>
----
Server IP: 45.112.84.4
Probable Submitter: 103.51.166.36 (proxied: 2600:6c50:57f:fa60:8c4d:e94f:b414:f066)
----
Manual Page -- http://php.net/manual/en/language.types.string.php
Edit -- https://master.php.net/note/edit/125281
Del: integrated -- https://master.php.net/note/delete/125281/integrated
Del: useless -- https://master.php.net/note/delete/125281/useless
Del: bad code -- https://master.php.net/note/delete/125281/bad+code
Del: spam -- https://master.php.net/note/delete/125281/spam
Del: non-english -- https://master.php.net/note/delete/125281/non-english
Del: in docs -- https://master.php.net/note/delete/125281/in+docs
Del: other reasons-- https://master.php.net/note/delete/125281
Reject -- https://master.php.net/note/reject/125281
Search -- https://master.php.net/manage/user-notes.php