Get Parameters From a URL String in PHP
phpCopy<?php
echo $_GET['email'] . $_GET['name']
?>
Get Parameters From a URL String in PHP
phpCopy<?php
echo $_GET['email'] . $_GET['name']
?>
getting values from url php
$id = $_GET['id'];
// OR
$id = $_REQUEST['id'];
Get Parameters From a URL String in PHP
phpCopy<?php
$url = "https://testurl.com/test/[email protected]&name=sarah";
$components = parse_url($url);
parse_str($components['query'], $results);
print_r($results);
?>
php get value from url
<a href="index.php?id=<?php echo $my_id;?>&name=<?php echo $my_name;?>Click</a>
<?php
$id = intval($_GET['id']); // integer value
$name = strval($_GET['name']); // string value
?>
Get Parameters From a URL String in PHP
phpCopy<?php
$url = "https://testurl.com/test/[email protected]&name=sarah";
$components = parse_url($url);
parse_str($components['query'], $results);
echo($results['email']);
?>
php get data from url
// previous link
<a href="test_get.php?subject=PHP&web=W3schools.com">Test $GET</a>
// the code
<?php
echo "Study " . $_GET['subject'] . " at " . $_GET['web'];
?>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us