-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
CodeIgniter version: 4.3.1
In this sample, there are three URI segments: 1:users, 2:15, 3:profile
But you can get the 4th segment $uri->getSegment(4, 'bar') without Exception.
But $uri->getSegment(5, 'baz') will throw Exception.
// URI = http://example.com/users/15/profile
// will print 'profile'
echo $uri->getSegment(3, 'foo');
// will print 'bar'
echo $uri->getSegment(4, 'bar');
// will throw an exception
echo $uri->getSegment(5, 'baz');
// will print 'baz'
echo $uri->setSilent()->getSegment(5, 'baz');
// will print '' (empty string)
echo $uri->setSilent()->getSegment(5);https://codeigniter4.github.io/CodeIgniter4/libraries/uri.html#uri-segments
Related: #7233
Metadata
Metadata
Assignees
Labels
No labels