![]() |
Function that checks if a segment key exists ? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Function that checks if a segment key exists ? (/showthread.php?tid=3594) |
Function that checks if a segment key exists ? - El Forum - 10-12-2007 [eluser]starbbs[/eluser] Call me stupid but i need a function that simply returns the key if this key exists inside the URI class. I cannot seem to fin it. Let me explain: Code: /** So, i was thinking that there might be a function, in where i can check for a key directly. But i cannot find this function. I created my own function. Maybe someone can think of a faster way: Code: // $name = the name of the segment you want to check If you have any suggestion for my problem, please reply! Thnks @ Function that checks if a segment key exists ? - El Forum - 10-13-2007 [eluser]xwero[/eluser] You use the second argument of the segment method, this means if the 6th segment is not found 0 will be returned so your is_numeric check will always be true. Function that checks if a segment key exists ? - El Forum - 10-29-2007 [eluser]starbbs[/eluser] Good one... |