• 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

How to increase the PHP upload limits [duplicate]

Change the alert text on add to cart action without selected variation in Woocommerce

str_word_count() function doesn't display Arabic language properly

How to use a PHP MVC Controller, one thats invoked by calling a URL, to call and execute more than one function? [duplicate]

Pass an image through AJAX [duplicate]

CONCAT columns with Laravel 5 eloquent

Laravel Passport - Not able to get token string in response?

SilverStripe unable to populate multiple member Childs

PHPExcel export HTML table to xlsx

Reducing authentication calls on external API (Laravel 5.6)

how to check version of codeigniter framework?

Laravel Mix Uncaught ReferenceError: $ is not defined

Can't remotely connect to MySQL error (13) with PHP script, connecting through CLI works

Performance of foreach, array_map with lambda and array_map with static function

Getting values for an enum?

About Contact Privacy policy Terms and conditions