<?php

$input = '1ab2v3g4de';
$length = \strlen($input);
$output = '';

for ($i = $length - 1; $i >= 0; --$i) {
	$output .= $input[$i];
}

\var_dump($output);