mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
is_countable?!
This commit is contained in:
parent
43fe12af13
commit
a641b3103a
10 changed files with 39 additions and 14 deletions
|
|
@ -691,4 +691,20 @@ function is_empty_html_content($str)
|
|||
$str = strip_tags($str, '<img><audio><video><iframe><object><embed>');
|
||||
$str = utf8_trim(utf8_clean(html_entity_decode($str, ENT_QUOTES, 'UTF-8')));
|
||||
return $str === '';
|
||||
}
|
||||
|
||||
/**
|
||||
* https://wiki.php.net/rfc/is-countable
|
||||
* Check if there is 'is_countable' function (PHP 7.3)
|
||||
* If there is no 'is_countable' function, define it for check Countable objects
|
||||
*
|
||||
* @param string $str The input string
|
||||
* @return bool
|
||||
**/
|
||||
if (!function_exists('is_countable'))
|
||||
{
|
||||
function is_countable($var)
|
||||
{
|
||||
return is_array($var) || $var instanceof Countable;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue