Jump to content

Retrieve string from URL


feras80

Recommended Posts

<?php
$url = $_SERVER['REQUEST_URI']; //will set $url to "/Rates/USA/1/China/2"
$bits = explode('/', $url);
// $bits[1] contains "Rates"
// $bits[2] contains "USA"
// $bits[3] contains "1"
// $bits[4] contains "China"
// $bits[5] contains "2"
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.