<?php $str = "We have received ##AMOUNT## ##CURRENCY## for your OrderID n. ##ORDER_ID##"; $AMOUNT = 123; $CURRENCY = 'GBP'; $ORDER_ID = 20123; $find = ['AMOUNT', 'CURRENCY', 'ORDER_ID']; echo str_replace( array_map(function($v){ return '##'.$v.'##'; }, $find), compact(...$find), $str );
You have javascript disabled. You will not be able to edit any code.