NYCPHP Meetup

NYPHP.org

[nycphp-talk] Getting fragment - after the hashmark

Alberto dos Santos acas at sapo.pt
Sat Jun 25 05:10:15 EDT 2005


Hy Hans.

Have you tryed to explode the url, it works for me with this little
function, which i changed for you ;)

function hashContent ($urlToBlow)
{
	$explodedUrl = explode("#", $urlToBlow); // this works because there
is only one # per url
	$reversedArray = array_reverse($explodedUrl); // because the part
you want will be at the end
	return $reversedArray[0]; // ask only the end...
} 

Hope this works for you.

--
Alberto dos Santos
email: acas at sapo.pt
skype: fatflash
 
Salvaguarda: Este email está protegido de vírus e programas maliciosos  

-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Hans Zaunere
Sent: sexta-feira, 24 de Junho de 2005 22:47
To: 'NYPHP Talk'
Subject: [nycphp-talk] Getting fragment - after the hashmark


This seems like a silly question, and something that would be common.

When managing URLs during PHP runtime, how do you get the fragment part that
comes after the hashmark?

http://us4.php.net/manual/en/function.parse-url.php

Says it will return an array containing the fragment part, but the function
also requires you to pass in the URL.  Yet, I can't find a way to get the
URL that includes the fragment, so it's a chicken-before-the-egg problem.

I'm probably forgetting the function or variable that does exactly what I
want, but I just can't place it.

Thanks,

H


_______________________________________________
New York PHP Talk Mailing List
AMP Technology
Supporting Apache, MySQL and PHP
http://lists.nyphp.org/mailman/listinfo/talk
http://www.nyphp.org




More information about the talk mailing list