CodeIgniter Forums
argument with dot - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: argument with dot (/thread-21587.html)



argument with dot - El Forum - 08-14-2009

[eluser]Louis![/eluser]
Hello everybody,

I have a little issue with an argument which contains a dot, for example :

http://www.example.com/galerie/delete/Desert.jpg

When i display the argument of the function delete i can see that the dot is transformed to an underscore, the value is : Desert_jpg

I don't think if it's a normal result, so if you can help me.

Thanks

Louis


argument with dot - El Forum - 08-14-2009

[eluser]richthegeek[/eluser]
so do a preg replace to change it back:
Code:
$file = preg_replace( "/(_)(jpg|png|gif)/", ".$2", $file );



argument with dot - El Forum - 08-14-2009

[eluser]pistolPete[/eluser]
Have a look at these threads:

http://ellislab.com/forums/viewthread/114218/
http://ellislab.com/forums/viewthread/123910/
http://ellislab.com/forums/viewthread/94091


argument with dot - El Forum - 08-14-2009

[eluser]Colin Williams[/eluser]
Use uri_protocol of REQUEST_URI and not PATH_INFO.


argument with dot - El Forum - 08-14-2009

[eluser]Louis![/eluser]
Thanks a lot, it's fine.