mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 23:06:08 -06:00
Merge pull request #1000 from openclassify/muammertop
added replace to text func
This commit is contained in:
commit
a6e47474d5
@ -31,4 +31,16 @@ if (!function_exists('auth_id_if_null'))
|
|||||||
function auth_id_if_null($userId) {
|
function auth_id_if_null($userId) {
|
||||||
return $userId ?: auth()->id();
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user