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
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Fri May 28, 2004 2:39 am
i have this url :
Code: Select all
<?php
http://localhost/uniprod/index.php?cont=WeightStations
?>
and i want to know only :
Code: Select all
<?php
http://localhost/uniprod/index.php
?>
how do i do that?
thnaks in advance
peleg
crookedgoomba
Forum Newbie
Posts: 4 Joined: Fri May 28, 2004 2:38 am
Post
by crookedgoomba » Fri May 28, 2004 2:52 am
how about:
Code: Select all
preg_match("/(.*)\?/","http://localhost/uniprod/index.php?cont=WeightStations",$boo);
echo $boo[1];
Last edited by
crookedgoomba on Fri May 28, 2004 3:02 am, edited 1 time in total.
JayBird
Admin
Posts: 4524 Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:
Post
by JayBird » Fri May 28, 2004 3:00 am
what about this
Code: Select all
$url = parse_url ( "http://localhost/uniprod/index.php?cont=WeightStations" );
echo $url['sheme'].$url['host'].$url['path'];
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Fri May 28, 2004 3:00 am
thnaks alot both of u:)