Jump to content

Get Method.


max_w1

Recommended Posts

 

here is what i am trying to do. i have a url in my browser like this: http://localhost/jmla/index.php?option=com_content&view=article&id=1295:sovereign-a-country-risk-workshop

 

as usuall we get elements form the url using the $_GET method, but here when i try to get id from the above url. i can get 1295:sovereign-a-country-risk-workshop. whereas the id is only 1295 and the other part is alias which i want to get seperately.

 

is there a way to do so?

 

Link to comment
Share on other sites

to add to Nightslyr's reply .............

 


list($idNumber, $idText) = explode(':', (htmlspecialchars($_GET['id'])));
echo $idNumber;

 

or you could do as voip03 suggested and just ignore d if you have no reason to call it.....

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.