Question: Can somebody help me to getting the last word from a text which contains only letters.

I should use regex I think...

For example:

```
100 r St Lazare, 75009 PARIS

```

I need the word `PARIS`

Answer: 
I'd like to suggest the following version, though it is still not perfect for all cases:

```
$input = '100 r St Lazare, 75009 PARIS 345'; // pass, returns "PARIS"
$input = '100 r St Lazare, 75009 PARIS';     // pass, returns "PARIS"
$input = 'this just a Ðöæ 75009';            // pass, returns "Ðöæ"
$input = 'this just a Ðöæ';                  // pass, returns "Ðöæ"
$input = 'this just a tes1t 75009';          // fail, returns "t"

$output = array();
preg_match( '/([^\s\d]+)[\s\d]*$/i', $input, $output );
$lastWordThatConsistsOnlyOfLetters = array_pop( $output );

var_dump( $lastWordThatConsistsOnlyOfLetters );

```

(@naveengoyal The test string you've posted is a hard one…)
you may try

```
$text = "100 r St Lazare, 75009 PARIS";
$exploded = explode(" ",$text);
echo $exploded[count($exploded)-1]

```