WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
PHP Web Logs (BLogs)
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Submit Site
Forex Trading Online forex trading platform
Checks if a language tag filter matches with locale

Locale::filterMatches

locale_filter_matches

(No version information available, might be only in CVS)

Locale::filterMatches -- locale_filter_matchesChecks if a language tag filter matches with locale

Description

Object oriented style

static boolean Locale::filterMatches ( string $langtag , string $locale )

Procedural style

boolean locale_filter_matches ( string $langtag , string $locale )

Checks if a $langtag filter matches with $locale according to RFC 4647's basic filtering algorithm

Parameters

langtag

The language tag to check

locale

The language range to check against

Return Values

TRUE if $locale matches $langtag FALSE otherwise.

Examples

Example #1 locale_filter_matches() example

<?php
echo (locale_filter_matches('de-DEVA','de-DE')) ? "Matches" "Does not match"
echo 
'; ';
echo (
locale_filter_matches('de-DE_1996','de-DE')) ? "Matches" "Does not match"
?>

Example #2 OO example

<?php
echo (Locale::filter_matches('de-DEVA','de-DE')) ? "Matches" "Does not match"
echo 
'; ';
echo (
Locale::filter_matches('de-DE-1996','de-DE')) ? "Matches" "Does not match"
?>

The above example will output:

 
 Does not match; Matches 

See Also