- substr: documentation ( source)
- date: documentation ( source)
- sprintf: documentation ( source)
<?php
$pos_faktura = "26769891/" . date('Y') . "/000";
$id = (int) substr($pos_faktura, -3);
$nova_faktura = substr($pos_faktura, 0, 14).sprintf("03d%", $id++);
echo "$nova_faktura";