-
Notifications
You must be signed in to change notification settings - Fork 0
/
banco.php
63 lines (48 loc) · 1.03 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
53
54
55
56
57
58
59
60
61
62
63
<?php
require_once ('arquivos_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'],
500
);
$contasCorrentes['123.456.689-11'] = sacar(
$contasCorrentes['123.456.689-11'],
200
);
$contasCorrentes['123.256.789-12'] = depositar(
$contasCorrentes['123.256.789-12'],
900
);
?>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</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>