-1

i have a small problem with echo in php

if (isset($_GET['id']) && is_numeric($_GET['id'])) {
$id = $_GET['id'];  
// copy file content into a string var
$json_file = file_get_contents('link.com?id_select='echo $id;');

how do i show the value of GET ID into the link?

Thanks <3

1 Answers1

2

You need to use concatenation you do that with a dot like so:

$json_file = file_get_contents('link.com?id_select='.$id);
Daan
  • 12,099
  • 6
  • 34
  • 51