Yngvarr

Generation

generate functionMon, 16 Jan 2023

replace last symbols

function replaceLast($str, $from, $to) { $pos = strrpos($str, $from); if($pos !== false) { $str = substr_replace($str, $to, $pos, strlen($from)); } return $str; }

Questions about programming?Chat with your personal AI assistant