Test Ar-PHP Functionality Online
Test PHP Function
Sub Class:
- Select one -
AutoSummarize
CharsetD
CompressStr
Date
Gender
Glyphs
Hiero
Identifier
KeySwap
Mktime
Normalise
Numbers
Query
Salat
Sort
Soundex
Standard
Stemmer
StrToTime
Transliteration
WordTag
Method:
- Select one -
identify
isArabic
str:
Result (
var_dump
output):
Ar-PHP Manual
static method identify
[line
122
]
static array identify( string $str)
Identify Arabic text in a given UTF-8 multi language string
Tags:
return:
Offset of the beginning and end of each Arabic segment in sequence in the given UTF-8 multi language string
author:
Khaled Al-Sham'aa <
khaled@ar-php.org
>
access:
public
Parameters:
string
$str
UTF-8 multi language string
Example
include
(
'./I18N/Arabic.php'
)
;
$obj
=
new
I18N_Arabic
(
'Identifier'
)
;
$hStr
=
$obj
->
highlightText
(
$str
,
'#80B020'
)
;
echo
$str
.
'<hr />'
.
$hStr
.
'<hr />'
;
$taggedText
=
$obj
->
tagText
(
$str
)
;
foreach
(
$taggedText
as
$wordTag
)
{
list
(
$word
,
$tag
)
=
$wordTag
;
if
(
$tag
==
1
)
{
echo
"
$word
is Noun,
"
;
}
if
(
$tag
==
0
)
{
echo
"
$word
is not Noun,
"
;
}
}
Popular
utf8Glyphs
(1231)
ar2en
(977)
money2str
(550)
en2ar
(400)
isFemale
(291)
Recent
(6 days)
utf8Glyphs
(9 days)
ar2en
(17 days)
identify
(26 days)
getPrayTime2
(78 days)
Links
Homepage
Download
Bug Report
Feature Request
My Blog
My Twitter
Ads!
Home
|
Twitter
|
Blog
|
Contact
Copyright © 2006 - 2016 Khaled Al-Sham'aa