-
Notifications
You must be signed in to change notification settings - Fork 0
/
banco.php
52 lines (47 loc) · 1.11 KB
/
banco.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
<?php
require_once 'funcoes.php';
$contasCorrentes = [
'123.456.789-10' => [
'titular' => 'Maria',
'saldo' => 10000
],
'123.456.689-11' => [
'titular' => 'Alberto',
'saldo' => 300
],
'123.256.789-12' => [
'titular' => 'Vinicius',
'saldo' => 100
]
];
$contasCorrentes['123.456.789-10'] = sacar(
$contasCorrentes['123.456.789-10'],
1999
);
$contasCorrentes['123.456.689-11'] = sacar(
$contasCorrentes['123.456.689-11'],
200
);
$contasCorrentes['123.256.789-12'] = depositar(
$contasCorrentes['123.256.789-12'],
900
);
?>
<!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">
<title>Curso Php Alura</title>
</head>
<body>
<h1>Contas correntes</h1>
<dl>
<?php foreach($contasCorrentes as $cpf => $conta){?>
<dt><h3><?= $conta['titular'];?> - <?= $cpf;?></h3></dt>
<dd>Saldo:<?= $conta['saldo'];?></dd>
<?php } ?>
</dl>
</body>
</html>