Page 1 of 1
reguller expression issue
Posted: Tue Jun 13, 2006 10:00 am
by itsmani1
Code: Select all
$str = "abc/jk/child"
$str1 = "abc/jk/"
$str2 = "abc/jk/child/end"
$str3 = "abc/jk/child/images/xyz"
in above strings i want to select the part which comes after last "/" sign. I am not familiar with reguller express, can anyone help me!
Regards.
Posted: Tue Jun 13, 2006 10:06 am
by feyd
No need for [sic] complicated regex,
basename() should work just fine...
Code: Select all
[feyd@home]>php -r "$str = 'abc/jk/child'; echo basename($str);"
child
Posted: Tue Jun 13, 2006 10:19 am
by itsmani1
thanks,
can i find size of an online page? like i wanted to know size of
http://www.maair.net/index.php can i find this, if i can how its done?
Regards.
Posted: Tue Jun 13, 2006 10:21 am
by feyd
Posted: Tue Jun 13, 2006 10:25 am
by itsmani1
thanks much
Posted: Tue Jun 13, 2006 10:54 am
by itsmani1
me again......
last thing left.
can i check permissions of some file, and when it was last modified? for example there is a page:
http://www.maair.net/index.php
can i check permissions on this file and can i check when it was modified last time.
Regards.
Posted: Tue Jun 13, 2006 10:56 am
by feyd
not via a remote request unless (some) information is passed via the HTTP headers (last modification time)
Posted: Tue Jun 13, 2006 11:02 am
by itsmani1
feyd wrote:not via a remote request unless (some) information is passed via the HTTP headers (last modification time)
which information is required to pass via http headers
Posted: Tue Jun 13, 2006 11:17 am
by feyd
It's not information you send, it's header information the server may respond with. It will, at best, only tell you when the file was last modified (it may be false, but there's no way to tell)