コード
<?php
// 定義されているかどうか?
//Null合体演算子
$a = 'aaaaaa';
echo $a ?? 'good bye';
echo PHP_EOL;
echo $c ?? 'レス急';
echo PHP_EOL;
// 値が入っているかどうか?
//エルビス演算子
$b = '';
echo $b ?: 'good bye';
echo PHP_EOL;
$sobi_data = "不倫";
$all = "{NAME}弁護士";
echo str_replace('{NAME}', $sobi_data,$all);
結果
aaaaaa
レス急
good bye
不倫弁護士