PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
itsmani1
Forum Regular
Posts: 791 Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:
Post
by itsmani1 » Tue Jun 13, 2006 10:00 am
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.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Jun 13, 2006 10:06 am
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
itsmani1
Forum Regular
Posts: 791 Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:
Post
by itsmani1 » Tue Jun 13, 2006 10:19 am
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.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Jun 13, 2006 10:21 am
itsmani1
Forum Regular
Posts: 791 Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:
Post
by itsmani1 » Tue Jun 13, 2006 10:25 am
thanks much
itsmani1
Forum Regular
Posts: 791 Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:
Post
by itsmani1 » Tue Jun 13, 2006 10:54 am
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.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Jun 13, 2006 10:56 am
not via a remote request unless (some) information is passed via the HTTP headers (last modification time)
itsmani1
Forum Regular
Posts: 791 Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:
Post
by itsmani1 » Tue Jun 13, 2006 11:02 am
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
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Jun 13, 2006 11:17 am
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)