Regenerating Path Aliases Programatically in Drupal 7

It should look something like this: