Skip to content

Instantly share code, notes, and snippets.

@prof3ssorSt3v3
Created June 2, 2018 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prof3ssorSt3v3/8db216fb88a395819607375fac5278e5 to your computer and use it in GitHub Desktop.
Save prof3ssorSt3v3/8db216fb88a395819607375fac5278e5 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Strings in PHP</title>
<meta name="viewport" content="width=device-width">
<style>
*{
padding: 0;
margin: 0;
}
html {
box-sizing: border-box;
font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", "Arial", sans-serif;
font-size: calc(1.5vh + 1vw + 1%);
line-height: 1.5;
-moz-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%;
}
*, *::before, *::after {
box-sizing: inherit;
}
body{
overflow: auto;
min-height: 100vh;
width: 100%;
}
main,
header{
padding: 1rem 2rem;
}
p{
padding: 0.5rem 0;
}
</style>
</head>
<body>
<header>
<h1>Strings in PHP</h1>
</header>
<main>
<?php
$str1 = 'single\' quotes';
$str2 = "double \t quotes";
$str3 = <<<"HEREDOC"
This string is inside
a heredoc block.
$str1
$str2
HEREDOC;
$str4 = <<<'NOWDOC'
This string is
inside a
nowdoc block.
$str1
$str2
NOWDOC;
echo '<p>$str1</p>';
echo "<p>$str2</p>";
echo "<p>${str2}</p>";
echo "<p><pre>$str3</pre></p>";
echo "<p><pre>$str4</pre></p>";
?>
</main>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment