SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 433 | Next

James Kennard

"Mastering Joomla! 1.5 Extension and Framework Development"

This is often
used for stripping out unwanted data. In this example we remove all digits.
$value = preg_replace('/\d/', '', $value);
The first parameter is the pattern, in this instance, digits. The second parameter is the
replacement string, in this instance, a null string. The final parameter is the subject.
We can take advantage of blocks in the same way as we did with preg_match().
Each matched block encapsulated in parentheses is assigned to a variable $1 through
$n. These variables are only accessible in the replacement parameter.
$pattern = '/^(\d{4})\D(\d{1,2})\D(\d{1,2})$/';
$replacement = '$1/$2/$3';
$value = '1791-12-26';
echo preg_replace($pattern,$replacement,$value);
This example will output:
1791/12/26
Access Control
Joomla!'s access control mechanisms are not as clear cut as they could be; this is due
to an ongoing development cycle that is moving away from a legacy access control
system. In the future, Joomla! will use a complete GACL (Group Access Control
Lists) access control mechanism.


Pages:
421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445
kettler wirtualne biuro parapety biuroserwis warszawa Odżywki na masę