Join Up!
104886 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousstrposstrrevnext
Last updated: Tue, 29 Oct 2002
view the printer friendly version or the printer friendly version with notes or change language to Czech | German

strrchr

(PHP 3, PHP 4 )

strrchr --  Encuentra la última aparición de un caracter en una cadena

Descripción

string strrchr ( string pajar, string aguja)

Esta función devuelve la porción del pajar que comienza en la última aparición de la aguja y continúa hasta el final del pajar.

Devuelve FALSE si la aguja no es hallada.

Si la aguja contiene más de un caracter, sólo se usará el primero.

Si la aguja no es una cadena, se convierte a entero y se aplica como el valor ordinal de un caracter.

Ejemplo 1. Ejemplo de strrchr()

// obtener el último directorio de $PATH
$dir = substr (strrchr ($PATH, ":"), 1);

// obtener todo tras el último salto de línea
$texto = "Line 1\nLine 2\nLine 3";
$apell = substr (strrchr ($texto, 10), 1 );

Vea también substr(), stristr(), y strstr().

User Contributed Notes
strrchr
add a note about notes
There are no user contributed notes for this page.
previousstrposstrrevnext
Last updated: Tue, 29 Oct 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST