<?php

    $str = '{c}
    <br>
    <br>
    test
    test<br>
    <br>{/c}
    <br>
    test
    test<br>
    
    {c}
    saddasda<br>
    {/c}
    
    {c}<br>test<br><br>{/c}
    {c}<br>{/c}';
    $new_str = preg_replace_callback('#(?<=\{c\}).*?(?=\{/c\})#s', function($matches) {
        return str_replace("<br>", "[linebreak]", $matches[0]);
    },$str);
    echo $new_str;
