[
'firstLevel1.secondLevel1.thirdLevel1' => 'thirdLevel1 value',
'firstLevel1.secondLevel2' => 'secondLevel2 value'
]
$str = 'https://domen.ru/wp-content/uploads/1.jpg xxxxxx
dsdgf sdfkgjsdkfl;jsdfg
https://drugoidomen.ru/wp-content/uploads/222.jpg yyyy
text text
https://domen.ru/wp-content/uploads/333.jpg zzzzz';
$re = '~(https:\/\/domen\.ru\/wp-content\/uploads\/(.*?)\.jpg)~mi';
$subst = 'https://domen.ru/wp-content/uploads/$2.png';
$result = preg_replace($re, $subst, $str);
var_dump($result);
<?php
$dict = [
'A' => '111',
'n' => '110',
'y' => '101',
' ' => '100',
't' => '01',
'e' => '001',
'x' => '000',
];
$str = 'Any text';
$result = strtr($str, $dict);
var_dump($result);
//string(22) "1111101011000100100001"
<?php
$route = Route::current();
$name = Route::currentRouteName();
$action = Route::currentRouteAction();
<li>
<?php if (!empty($featured_categories)): ?>
<div class="featured-categories">
<div class="categories__inner">
<div class="section-heading">Выберите категорию</div>
<ul class="categories__list">
<?php foreach ($featured_categories as $category): ?>
<li id="#" class="categories__item">
<span class="category-item__image" style="<?php echo get_category_image_url($category); ?>">
<a href="<?php echo generate_category_url($category); ?>" class="category-item">
<span class="category-item__separator"></span>
<span class="category-item__title"><?php echo category_name($category); ?></span>
</a>
</span>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
<?php endif; ?>