Upgrade to 3.0.2
This commit is contained in:
@@ -118,7 +118,9 @@ class Html
|
||||
if (isset($value['value']) && isset($value['escape'])) {
|
||||
$value = $value['escape'] === true ? htmlspecialchars($value['value'], ENT_QUOTES, 'UTF-8') : $value['value'];
|
||||
} else {
|
||||
$value = implode(' ', $value);
|
||||
$value = implode(' ', array_filter($value, function ($value) {
|
||||
return !empty($value) || is_numeric($value);
|
||||
}));
|
||||
}
|
||||
} else {
|
||||
$value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
|
||||
|
@@ -336,6 +336,20 @@ class Str
|
||||
return static::substr($string, 0, strrpos(static::substr($string, 0, $chars), ' ')) . ' ' . $rep;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the value to a float with a decimal
|
||||
* point, no matter what the locale setting is
|
||||
*
|
||||
* @param string|int|float $value
|
||||
* @return string
|
||||
*/
|
||||
public static function float($value): string
|
||||
{
|
||||
$value = str_replace(',', '.', $value);
|
||||
$decimal = strlen(substr(strrchr($value, "."), 1));
|
||||
return number_format((float)$value, $decimal);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the rest of the string starting from the given character
|
||||
*
|
||||
|
Reference in New Issue
Block a user