You are here: REGEXP problem « PHP Programming Language « IT news, forums, messages
REGEXP problem

Posted by frizzle on 10/12/06 14:44

Hi there,

I'm not really experienced with regexpes etc. so that's why i come
here.
My script needs to parse the requested filename:

Imagine the filename is index_en.html
My output needs to be an array with the following:
language => en (no underscore)
file => index (no "_en")
extension => html

i created the following, but i don't know how to move on:
preg_split( '/^[a-z0-9]*(_(en|_ru))?\.[a-z0-9]{2,4}$/', $filename );

As you can see, the _en part can be left out (index.html) wich would
have to return
language => default

I hope it's clear, cause i really need to get this going!

Thanks.

Frizzle.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация