How to pass array to another page by using anchor in php
php
Solution
This is clear example code
first.php
<?php
$Mixed = array("1","2","3");
$Text = json_encode($Mixed);
$RequestText = urlencode($Text);
?>
<a href="second.php?cluster=<?php echo $RequestText; ?>">Click</a>
second.php
<?php
$Text = urldecode($_REQUEST['cluster']);
$Mixed = json_decode($Text);
print_r( $Mixed);
?>
I have checked, and it is working fine.
Problem
I have to pass an array value from one php page to another php page using `<a href>` ... here is my coding `$cluster` is an array ``` echo "<td><a href=myebon.php&cluster[]=".$cluster.">Click here to OFF</a></td>"; ``` in myebon.php ``` $n=count($_GET[cluster]); for($i=0;$i<=$n;$i++) { echo $cluster[$i]=$_GET['cluster'][$i]; } ``` The value is not accessible in the second page, it's displaying as array but not the values. I have tried serialization concept too ...