-
Notifications
You must be signed in to change notification settings - Fork 0
/
strings.php
68 lines (52 loc) · 2.1 KB
/
strings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<title>Strings</title>
</head>
<body>
<div class="container">
<h3>Strings</h3>
<?php
$text1 = "Em PHP, as strings podem ser delimitadas por aspas simples ' (single quote) e aspas duplas \" (double quote).";
echo $Newtext1 = wordwrap($text1, 70);
?>
<br/>
<br/>
<?php
$a = 'Esta é uma string.';
$b = "Esta é outra string.";
echo $a;
echo $b;
?>
<p>
Nas PSRs não existe uma orientação definida para o uso de aspas
simples ou aspas duplas. Devemos ser consistentes ao logo do nosso código.
</p>
<br/>
<br/>
<?php
$text2 = "É o processo que, através do codigo, permite juntar árias strings. Existem dois operadores de concatenação: <br>\n . (ponto)<br>\n .= (ponto igual)";
echo $Newtext2 = wordwrap($text2, 70);
?>
<br/>
<br/>
<?php
$c = 'Rodrigo' . ' ' . 'Augsuto'; echo "O ponto liga as diferentes strings.";
echo $c;
?>
<br/>
<br/>
<?php
$d = 'Rodrigo';
$d .= ' ' . 'Augusto'; echo "o .= faz uma concatenação com o valor já existente na string";
echo $d
?>
</div>
</body>
</html>