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 -
isNoun
tagText
highlightText
str:
style:
Result (
var_dump
output):
Ar-PHP Manual
static method highlightText
[line
323
]
static string highlightText( string $str, [string $style = null])
Highlighted all nouns in a given Arabic string
Tags:
return:
Arabic string in HTML format where all nouns highlighted
author:
Khaled Al-Sham'aa <
khaled@ar-php.org
>
access:
public
Parameters:
string
$str
Arabic string you want to highlighted all its nouns
string
$style
Name of the CSS class you would like to apply
Example
include
(
'./I18N/Arabic.php'
)
;
$obj
=
new
I18N_Arabic
(
'WordTag'
)
;
$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
"
<font color=#DBEC21>
$word
is Noun</font>,
"
;
}
if
(
$tag
==
0
)
{
echo
"
$word
is not Noun,
"
;
}
}
Popular
utf8Glyphs
(1182)
ar2en
(965)
money2str
(550)
en2ar
(394)
isFemale
(291)
Recent
ar2en
(2 days)
str2graph
(2 days)
a4Lines
(13 days)
utf8Glyphs
(13 days)
money2str
(34 days)
Links
Homepage
Download
Bug Report
Feature Request
My Blog
My Twitter
Ads!
Home
|
Twitter
|
Blog
|
Contact
Copyright © 2006 - 2016 Khaled Al-Sham'aa