mirror of
https://github.com/friendica/friendica
synced 2025-04-24 12:30:10 +00:00
Rewrite Term class
- Move term type constants from TERM_* to Term::* - Move term object type constants from TERM_OBJ_* to Term::OBJECT_TYPE_* - Add Term::isType() method - Add Strings::startsWith() method
This commit is contained in:
parent
cd53585101
commit
1917f04153
3 changed files with 209 additions and 108 deletions
|
@ -331,4 +331,19 @@ class Strings
|
|||
|
||||
return $uri;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if the trimmed provided string is starting with one of the provided characters
|
||||
*
|
||||
* @param string $string
|
||||
* @param array $chars
|
||||
* @return bool
|
||||
*/
|
||||
public static function startsWith($string, array $chars)
|
||||
{
|
||||
$return = in_array(substr(trim($string), 0, 1), $chars);
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue