PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
// Sends a plain text header so the output will be easy to debug
header('Content-Type: text/plain');
// Initializes an array to hold the URL arguments
$args = array();
// Loops through an array containing $_REQUEST indexes
foreach (array('utm_source', 'utm_medium', 'utm_campaign') as $arg) {
// Checks if the element is not empty
if (!empty($_REQUEST[$arg])) {
// Adds an argument to the array in the form "name=value"
$args[] = $arg.'='.$_REQUEST[$arg];
}
}
// Adds another argument
$args[] = 'pg=1';
// Joins the arguments together with an ampersand "name1=value1&name2=value2"
echo "<a href='blocks.php?".implode('&', $args)."'><span class='paginator'>First</span></a> ";
?>
Edit: This post was recovered from search engine cache.