There are two types of wildcards. They are:
Note: Wildcards are aliases to the Regular Expressions. With :any being translated to [^/]+ and :num to [0-9]+, respectively.
:num : It matches the segment that has only numbers. For example,
[php]$route['(records/:num)'] = 'student/details/$1';[/php]
In the above example code, it can be observed that "records" is first segment of the URL, and second segment :num will remap to the class "student" and the "details" method passing in the match as a variable to the function.
If invoked https://www.school.com/records/1 or https://www.school.com/records/2 it will redirect to https://www.school.com/student/details/$1.
:any : It matches the segment that has only characters. For example,
[php]$route['(records/:any)'] = 'student/details';[/php]
In the above example code, it can be observed that "records" is first segment of the URL, and second segment :any will remap to the class "student" and the "details" method passing in the match as a variable to the function.
https://www.school.com/records/john or https://www.school.com/records/mike is invoked it will redirect to https://www.school.com/student/details.
Note : Here records is the controller and details is controller function.
Note : Do not use leading/trailing slashes.