-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunciones_rutas.php
More file actions
54 lines (46 loc) · 1.49 KB
/
funciones_rutas.php
File metadata and controls
54 lines (46 loc) · 1.49 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="css/style.css">
<title>Funciones de rutas</title>
</head>
<body>
<div class="card" style="width: 25rem;margin: auto;">
<h6 class="card-header">
FUNCIONES DE RUTAS
</h6>
<div class="card-block">
<h6>PATHINFO_BASENAME</h6>
<?php echo pathinfo('archivos/documento.txt', PATHINFO_BASENAME);?>
<hr>
<h6>PATHINFO_DIRNAME</h6>
<?php echo pathinfo('archivos/documento.txt', PATHINFO_DIRNAME);?>
<hr>
<h6>PATHINFO_EXTENSION</h6>
<?php echo pathinfo('archivos/documento.txt', PATHINFO_EXTENSION);?>
<hr>
<h6>PATHINFO_FILENAME</h6>
<?php echo pathinfo('archivos/documento.txt', PATHINFO_FILENAME);?>
<hr>
<h6>GLOB()</h6>
<!-- Obtiene todos los archivos con extensión php, html o txt -->
<?php $archivos = glob('fundamentos/a*.{php,html,txt}', GLOB_BRACE);?>
<ul>
<?php foreach ($archivos as $archivo): ?>
<li><?php echo $archivo; ?></li>
<?php endforeach; ?>
</ul>
<hr>
<h6>BASENAME()</h6>
<?php echo basename('archivos/documento.txt');?>
<hr>
<h6>BASENAME() Sin Extensión</h6>
<?php echo basename('archivos/documento.txt','.txt');?>
<hr>
<h6>DIRNAME()</h6>
<?php echo dirname('fundamentos/css/style.txt');?>s
</div>
</div>
</body>
</html>