Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. <?php
  2. $var = 8;
  3.  
  4. // Inline variable parsing
  5. echo "I'd like {$var} mangoes"; // = "I'd like 8 mangoes
  6.  
  7. // String concatenation
  8. echo "I'd like ".$var." mangoes"; // I'd like 8 mangoes
  9.  
  10. // Explicit cast
  11. $items = (string)$var; // $items === "8";
  12.  
  13. // Function call
  14. $items = strval($var); // $items === "8";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement