BASE . LOG, 'log_file_id' => $LOG_FILE_ID, 'log_per_date' => true, ]); // define a list of from to color sets for conversion test $PAGE_NAME = 'TEST CLASS: HTML BUILD: STRING REPLACE'; print ""; print "
" . htmlentities(StringReplace::replaceData(
$html_block,
[
'ID', 'CSS', '{CONTENT}'
],
[
'block-id', join(',', ['blue', 'red']),
'Some content here
with bla bla inside'
]
)) . "";
StringReplace::loadElements(
['foo', $html_block],
['bar', <<{CONTENT}
HTML]
);
print "Get: " . htmlentities(StringReplace::getElement('bar') ?: '') . '';
print "Build element: " . htmlentities(StringReplace::buildElement(
'bar',
['ID}', '{CONTENT'],
['new-id', 'Test cow 日本語']
)) . '' ;
print "Build element as replace: " . htmlentities(StringReplace::buildElement(
'bar',
['ID}', '{CONTENT'],
['diff-id', 'Test cow 日本語. More text plus'],
'rpl-1'
)) . '' ;
print "Get replacement: " . htmlentities(StringReplace::getReplaceBlock('rpl-1')) . "";
print "";
// __END__