Last active
August 28, 2020 09:06
-
-
Save vdite/79919fa33a3e4fbf505c to your computer and use it in GitHub Desktop.
How to transfer an Array over URL GET Parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* array_over_get.php */ | |
$image_arr=array("1.jpg","2.jpg","3.jpg","4.jpg","5.jpg","6.jpg"); | |
$serial_arr=urlencode(base64_encode(serialize($image_arr))); | |
echo '<img src="process_images.php?arr='.$serial_arr.'" alt="stacked image"/>'; | |
?> | |
<?php | |
/* process_images.php */ | |
$image_arr=unserialize(base64_decode(urldecode($_GET['arr']))); | |
foreach($image_arr as $value){ | |
/* do anything here | |
* just as an example | |
* https://gist.github.com/vdite/30644e28301916789ff5 | |
*/ | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
more about here: https://mizine.de/html/array-ueber-get-url-parameter-uebergeben/