API17:JString::strcmp
From Joomla! Documentation
(Difference between revisions)
(Layout updates) |
(Updated to r1448:247ba8d88526) |
||
| Line 2: | Line 2: | ||
=={{JVer|11.1}} JString::strcmp== | =={{JVer|11.1}} JString::strcmp== | ||
===Description=== | ===Description=== | ||
| − | UTF-8/LOCALE aware alternative to strcmp A case | + | UTF-8/LOCALE aware alternative to strcmp A case sensitive string comparison. |
{{Description:JString::strcmp}} | {{Description:JString::strcmp}} | ||
| Line 8: | Line 8: | ||
<nowiki>[</nowiki>[[Description:JString::strcmp|Edit Descripton]]<nowiki>]</nowiki> | <nowiki>[</nowiki>[[Description:JString::strcmp|Edit Descripton]]<nowiki>]</nowiki> | ||
</span> | </span> | ||
| − | |||
<source lang="php"> | <source lang="php"> | ||
| − | public static | + | public static function strcmp ( |
| + | $str1 | ||
| + | $str2 | ||
| + | $locale=false | ||
| + | ) | ||
</source> | </source> | ||
{| class="wikitable" | {| class="wikitable" | ||
| Line 32: | Line 35: | ||
|mixed | |mixed | ||
|false | |false | ||
| − | |The locale used by strcoll or false to use classical comparison | + | |The locale used by strcoll or false to use classical comparison |
|- | |- | ||
|} | |} | ||
| − | + | * '''Returns''' int < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal. | |
| − | int < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal. | + | * '''Defined''' on line 247 of libraries/joomla/utilities/string.php |
| − | + | * '''Referenced by''' | |
| − | libraries/joomla/utilities/string.php | + | ** [[JArrayHelper::_sortObjects/11.1|JArrayHelper::_sortObjects]] |
| − | * | + | |
| − | + | ||
| − | * [[JArrayHelper::_sortObjects/11.1|JArrayHelper::_sortObjects]] | + | |
===See also=== | ===See also=== | ||
| + | * {{JVer|11.1}} '''JString::strcmp source code''' on [[jplatform:utilities/string.php#cl-239|BitBucket]] | ||
| + | * {{JVer|11.1}} Class [[JString/11.1|JString]] | ||
| + | * {{JVer|11.1}} Subpackage [[Subpackage_Utilities/11.1|Utilities]] | ||
| + | * [[JString::strcmp|Other versions of JString::strcmp]] | ||
| + | {{SeeAlso:JString::strcmp}} | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[</nowiki>[[SeeAlso:JString::strcmp|Edit See Also]]<nowiki>]</nowiki> | <nowiki>[</nowiki>[[SeeAlso:JString::strcmp|Edit See Also]]<nowiki>]</nowiki> | ||
</span> | </span> | ||
| − | + | ===User contributed notes=== | |
| − | + | ||
| − | + | ||
| − | === | + | |
<CodeExamplesForm /> | <CodeExamplesForm /> | ||
<dpl> | <dpl> | ||
| Line 57: | Line 59: | ||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
| + | namespace=CodeExample | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
<noinclude>[[Category:JString]][[Category:JString::strcmp]]</noinclude> | <noinclude>[[Category:JString]][[Category:JString::strcmp]]</noinclude> | ||
Revision as of 21:44, 27 April 2011
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
JString::strcmp
Description
UTF-8/LOCALE aware alternative to strcmp A case sensitive string comparison.
Description:JString::strcmp [Edit Descripton]
public static function strcmp ( $str1 $str2 $locale=false )
| Parameter | Type | Default | Description |
|---|---|---|---|
| $str1 | string | string 1 to compare | |
| $str2 | string | string 2 to compare | |
| $locale | mixed | false | The locale used by strcoll or false to use classical comparison |
- Returns int < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal.
- Defined on line 247 of libraries/joomla/utilities/string.php
- Referenced by
See also
-
JString::strcmp source code on BitBucket
-
Class JString
-
Subpackage Utilities
- Other versions of JString::strcmp
SeeAlso:JString::strcmp [Edit See Also]
User contributed notes
<CodeExamplesForm />
