Incluye el archivo ( lib/include.php ) en el archivo ( index.php ) e imprime las variables en el ( body ) del archivo ( index.php )
archivo index.php:
Código
<?php
?>
<!DOCTYPE html>
<html>
<head>
<title>Include y require en PHP</title>
</head>
<body>
</body>
</html>
archivo lib/include.php:
Código
<?php
$funciones = ['isset', 'unset', 'file_exists', 'get_file_contents', 'in_array', 'is_array'];
$nombre = "PHP & MySQL";
$cantidad = 15.69;
?>
ejercicio 2
Require el archivo ( lib/require.php ) en el archivo ( index.php ) y convierte el retorno del archivo en array e imprímelo en el ( body ) del archivo ( index.php )
index.php:
Código
<?php
?>
<!DOCTYPE html>
<html>
<head>
<title>Include y require en PHP</title>
</head>
<body>
</body>
</html>
archivo lib/require.php
Código
<?php
return '{
"nombre" : "SDQ Training Center",
"cursos" : [
"PHP & MySQL",
"AutoCAD",
"Revit",
"HTML 5 & CSS 3",
"Java"
],
"fecha" : "2009-05-10"
}';
?>


 
  




 Autor
 Autor
		


 En línea
									En línea
								




 
						