**// User Function to replace string by Occurance**
function str_occ_replace($from,$to,$subject,$occ){
$myArray = explode($from,$subject);
print_r($myArray);
$mystring = '';
$index = 1;
foreach($myArray as $ele){
if($index !== $occ AND $index !== $arraySize)
$mystring .= $ele.$from;
else if($index !== $arraySize)
$mystring .= $ele.$to;
$index++;
} // End of Foreach
return $mystring;
} // End of Function