Is this possible to pass the php variable to the url?

my code is:

<?php

	$array1 = array("iphone", "ipad","iMac");

	for($test = 0; $test <= 2; $test++)
{
	echo '<a href="https://www.google.com?$array1[$test]">Click me</a><br />';
}

	
?>

How do i do that when i click on the link it will show the search results???

Recommended Answers

All 2 Replies

Now what is the output of the above code?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.