includes/helpers.php
/**
	 * Replace a given pattern with each value in the array in sequentially.
	 *
	 * @param string $pattern
	 * @param array $replacements
	 * @param string $subject
	 * @return string
	 */
Replace a given pattern with each value in the array in sequentially.
@param string $pattern
@param array $replacements
@param string $subject
@return string
Replace a given pattern with each value in the array in sequentially . @param string $pattern @param array $replacements @param string $subject @return string
function preg_replace_array($pattern, array $replacements, $subject) {
		return preg_replace_callback($pattern, function () use (&$replacements) {
			foreach ($replacements as $key => $value) {
				return array_shift($replacements);
			}
		}, $subject);
	}
function preg_replace_array ( $ pattern , array $ replacements , $ subject ) { return preg_replace_callback ( $ pattern , function ( ) use ( & $ replacements ) { foreach ( $ replacements as $ key => $ value ) { return array_shift ( $ replacements ) ; } } , $ subject ) ; }
Replace a given pattern with each value in the array in sequentially.
Replace a given pattern with each value in the array in sequentially .