Welcome,
I'm looking for small function what allow me to remove extension from filename.
I found many examples on the Google but there are bad because just remove part of string with "." . They use dot for limitter and just cut string.
Look at this scripts
$from = preg_replace('/\.[^.]+$/','',$from);
OR
$from=substr($from, 0, (strlen ($from)) - (strlen (strrchr($filename,'.'))));
When we add sting like this: This.is example of somestring
It will return only "This"...
Extension can have 3 or 4 char, so we have to check if dot is on 4 or 5 position, and then remove it.
Any idea ?
Regards