Answer the question
In order to leave comments, you need to log in
Bitrix.Replacing a piece of code via str_replace?
In this piece of code
<label><?=$arQuestion["CAPTION"]?>
<?if ($arQuestion["REQUIRED"] == "Y"):?><?=$arResult["REQUIRED_SIGN"];?><?endif;?></label>
<?=$arQuestion["HTML_CODE"]?>
<label>Как к вам обращаться? <font color='red'><span class='form-required starrequired'>*</span></font></label>
<input type="text" class="inputtext" name="form_text_4" value="" size="0" />
Answer the question
In order to leave comments, you need to log in
Yes, you can, like this:
<?
ob_start();
?>
<label><?=$arQuestion["CAPTION"]?><?if ($arQuestion["REQUIRED"] == "Y"):?><?=$arResult["REQUIRED_SIGN"];?><?endif;?></label>
<?
$label = ob_get_contents();
ob_end_clean();
?>
<?
ob_start();
?>
<label><?=$arQuestion["CAPTION"]?>
<?if ($arQuestion["REQUIRED"] == "Y"):?><?=$arResult["REQUIRED_SIGN"];?><?endif;?>
</label>
<?
$label = ob_get_contents();
ob_end_clean();
?>
<?
echo $str = str_replace("font color='red'", "span", $label);
echo $str = str_replace("/font", "/span", $str);
?>
<label>Как к вам обращаться? <span><span class='form-required starrequired'>*</span></font></label>
<label>Как к вам обращаться? <span><span class='form-required starrequired'>*</span></span></label>
<label>Как к вам обращаться?<span><span class='form-required starrequired'>*</span></span></label>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question