Jump to content

[SOLVED] Extracting a urlvariable from string?


darkwolf

Recommended Posts

i think you could do

 

$v = $_GET['v'];

 

echo $v;

 

~ Chocopi

 

Uhhh... thats just echo $_GET['v']..... there is none set? Thats not helpful......

 

....

 

 

 

<?php

$go = $_GET["go"];
$query = parse_url($go, PHP_URL_QUERY);
parse_str($query, $result);

$v = $result["v"];

echo $v;

?>

 

;)

 

 

Sorry but that errors... I modified your method just a bit different and go it to work.

 

Thanks very much.

 

 

 

Heres the code if anyone needs

 

 

<?

$query=parse_url($go);

parse_str($query[query], $result);

echo $result['v'];

?>

 

YAY!

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.