Reply to Re: to extract word

Your name:

Reply:


Posted by Ian Hobson on 10/03/07 10:09

artev wrote:
> if by PHP_SELF
> I have some similar:
> /localhost/namefile.php
> is possible to extract only this :
> namefile.php
>
> (is possible also have only namefile -no extension-)
>
> or is there a specific function?

First thing to do is to get clear on what EXACTLY you want to do. This
helps in programming tremendously.

If you want to extract everything following the last "/" up to, but not
including the next ".", then look up regular expressions and preg_match
in the manual.

If you want to divide the string up at every "/" and take the last, look
up "explode" and "count" in the manual.

But I would actually start by understanding what $_SERVER['PHP_SELF']
returns. This is a predefined variable, and you can find it under that
name in the manual.

Regards

Ian

[Back to original 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

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