Created
March 28, 2017 10:02
-
-
Save MrJSdev/8bf4ddad9471b91663ce42d5bb38cdb8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $var = 8; | |
| // Inline variable parsing | |
| echo "I'd like {$var} mangoes"; // = "I'd like 8 mangoes | |
| // String concatenation | |
| echo "I'd like ".$var." mangoes"; // I'd like 8 mangoes | |
| // Explicit cast | |
| $items = (string)$var; // $items === "8"; | |
| // Function call | |
| $items = strval($var); // $items === "8"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment