• 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 render html from a @foreach loop in a textarea

Add 2 Webcam in one page with WebcamJS

Store multiple fields in JSON column (Nova CMS)

Laravel - Browser displays message again when I press back button

PHP array, move keys and values to new array, but mix it up

How to map the two arrays with a duplicate value?

Select option from dropdown menu with PHP and mySql

How to put php code inside opening and closing shortcodes

LARAVEL: How to fetch id dynamically in a query builder?

php: command not found Command PhaseScriptExecution failed with a nonzero exit code

Laravel 4 Redirect::back() not going to previous page (refreshing current page)

Add bold text and line break into Laravel Notification Email

CodeIgniter 4: Like and Dislike Functionality

PHPUnit 7: Failed asserting that exception of type InvalidArgumentException is thrown

Json_Encode not returning html even i try to encode JSON_HEX_QUOT | JSON_HEX_TAG

About Contact Privacy policy Terms and conditions