Create and check uniquness of a slug id in php