Irgendwie doch nicht:
Code:
<?php
$regExp = "/^[\pL]*$/";
var_dump( preg_match($regExp, 'Hallo') );
var_dump( preg_match($regExp, 'Halloä'));
?>
Code:
(19:51:42) [test] php test.php
X-Powered-By: PHP/4.4.9
Content-type: text/html
int(1)
int(1)
(19:51:49) [test] vim test.php
(19:52:26) [test] php5 test.php
X-Powered-By: PHP/5.2.13
Content-type: text/html
int(1)
int(0)
Aber ein:
Code:
<?php
$regExp = "/^[\pL]*$/u";
var_dump( preg_match($regExp, 'Hallo') );
var_dump( preg_match($regExp, 'Halloä'));
?>
Liefert bei beiden Versionen:
Code:
(19:55:28) [test] php test.php
X-Powered-By: PHP/4.4.9
Content-type: text/html
int(1)
int(1)
(19:55:32) [test] vim test.php
(19:56:08) [test] php test.php
X-Powered-By: PHP/4.4.9
Content-type: text/html
int(1)
int(1)
(19:56:10) [test]
Sorry für den Nachtrag
Lesezeichen