-2

I have two pages how can i get the value from the product page through url if i click on the product name it redirect to specification page and get the value from the producat page array.

PHP

product page

$array1 = Array(["b"]=>"value['brand']",
            ["ref"]=>"value2['reference']

<a href="product.php?post=reference&<?php echo urlencode(serialize($array1));?>">

<h3 id="custompage">Product Name</span></h3></a>

Specification PAGE

<h3 id="custom"><?php echo $_GET['brand']; ?><span><br></span></h3>
Neil
  • 14,063
  • 3
  • 30
  • 51

1 Answers1

0

Your looking for http_build_query().

<?php

$array1 = Array(
    "b"=>"brand",
    "ref"=>"reference");

echo http_build_query($array1);
//b=brand&ref=reference

echo http_build_query($array1, '', '&amp;');
//b=brand&ref=reference

?>
Leo
  • 7,274
  • 5
  • 26
  • 48