Hola. >:(
Aquí dejo el Ejercicio CU00838B del tutorial básico de programación web con PHP desde cero.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>PHP Desde cero aprenderaprogramar.com</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="generator" content="Geany 1.27" />
</head>
<body>
<h1>Ejercicio 38(CU000838B) PHP </h1>
<?php echo ' <div>';print '<h2>Extraer código fuente de página web con PHP. <br/> Leer archivos completos: file_get_contents y nl2br (CU00838B)</h2>'; echo "<h1>Ejercicio 1</h1>";$texto = file_get_contents("miArchivoDePrueba.txt");echo nl2br($texto);echo "<h1>Ejercicio 2</h1>";//Ejercicio 2$pagina = array('http://www.ite.educacion.es/', 'http://es.lipsum.com/', 'http://pagoranking.com/'); $Caracter="h1";for ($i=0; $i<3;$i++){cogerCodigo ($pagina[$i],$Caracter);}echo '<br/>';echo '</div>';function cogerCodigo($pag,$Car){$Linea=file_get_contents($pag);echo "El caracter $Car aparece ".substr_count($Linea,$Car)." Veces en $pag <br/>";}?>
</body>
</html>
Hasta las bases de datos
;)