Re: Entre $variable y $variable2
| From: | -AzTk- | Date: | Wed, 08 Aug 2001 01:16:22 +0000 |
| Subject: | Re: Entre $variable y $variable2 | ||
| References: | 1 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-12799@lists.php.net to get a copy of this message | ||
algo asi???
function html() {
$texto = $this->abrir_archivo();
$inicia_bloque = "<" . $this->inicio . " " . func_get_arg(0) .
">";
$termina_bloque = "<" . $this->final . " " . func_get_arg(0) .
">";
$posicion_a = strpos($texto,$inicia_bloque);
$posicion_a += strlen($inicia_bloque);
$posicion_b = strpos($texto,$termina_bloque);
$posicion_b = ($posicion_b - $posicion_a);
$salida = substr($texto,$posicion_a,$posicion_b);
if (@func_get_arg(1)) {
$x = func_num_args();
for ($i = 1; $i < $x; $i+=2) {
$insertar_texto = "<" . $this->put . " " .
func_get_arg($i) . ">";
$valor = func_get_arg($i+1);
$salida = str_replace($insertar_texto,$valor,$salida);
}
}
return $salida;
}
es una funcion que hice hace un tiempo para hacer un template,
creo que te puede servir, suerte.
-AzTk-
--- Luis Roberto Lozano <luislozano@webhostix.com> escribió: >
Hola lista que tal:
>
> Quisiera saber si a un $linea se le puede sacar los caracteres
> que esten
> entre $var1 y $var2 y me lo aviente a un $resultado
>
>
>
>
---------------------------------------------------------------------
> Archivo On-line: http://www.phpes.com/
> Manual PHP en español: http://www.php.net/manual/es/
> Para dar de baja la suscripción, mande un mensaje a:
> lista-unsubscribe@phpes.com
>
_________________________________________________________
Do You Yahoo!?
Construye tu página personal en Yahoo! GeoCities. ¡Es fácil,
rápido y gratis! http://geocities.yahoo.com.mx