Merge pull request #1000 from openclassify/muammertop

added replace to text func
This commit is contained in:
spektra2147 2021-03-22 17:59:04 +03:00 committed by GitHub
commit a6e47474d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,4 +31,16 @@ if (!function_exists('auth_id_if_null'))
function auth_id_if_null($userId) {
return $userId ?: auth()->id();
}
}
if (!function_exists('replace_to_text'))
{
function replace_to_text($content, $array)
{
foreach ($array as $key => $value) {
$content = str_replace('${' . $key . '}', $value, $content);
}
return $content;
}
}