explode url file name $1=

They have: 18 posts

Joined: Feb 2005

I have a url to seperate for a query

something.com/site-fun-sun.htm

how would it be possible to associate the words before the extension .htm

example:

echo "$1"; > = fun

$1=fun
$2=sun
$3=site

He has: 77 posts

Joined: Apr 2005

Ok, what language do you want this done in? PHP, ASP, CGI/Perl, CGI/C, Java, Javascript (it's possible).

Busy's picture

He has: 6,151 posts

Joined: May 2001

Variables usually can't be a number (start with a number)

If you're using PHP or something you can use mod rewrite to convert page names or variable names; ie something.com/site to site = $site (or fun or sun or whatever)

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.