• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Appending data to an anchor tag

phphtml


PHP Snippet 1:

<a href="?ref=login_detail&id=<?php echo $car_id ?>">Hello</a>

PHP Snippet 2:

var_dump($_GET['id']);

PHP Snippet 3:

class Obj
{
    public function login_detail($id)
    {
        //do something with passed $id
        echo $id;
    }
}

(...)
$obj = new Obj();
$obj->login_detail($_GET['id']);

PHP Snippet 4:

class Obj
{
    public function login_detail($id)
    {
        echo $_GET['id'];
    }
}
$obj = new Obj();
$obj->login_detail();

Related Snippets

Laravel SQL query midnight time not showing

Target class controller does not exist - Laravel 8

cakephp save drag and drop list order to database

Symfony Error: "An exception has been thrown during the rendering of a template"

PHPExcel file download using AJAX call

Creating live search with AJAX and CodeIgniter

PHP | "The requested PHP extension bcmath is missing from your system."

How do I enable error reporting in Laravel?

ConstraintViolationListInterface to Exception in Symfony

Popup Window and PHP form

Display a product custom field only in WooCommerce Admin single orders

How to create custom authentication in laravel 8?

Laravel Delete and Update

PHP: set a (deep) array key from an array [closed]

Laravel/docker-compose/redis - Class 'Redis' not found

About Contact Privacy policy Terms and conditions