Home › Forums › General Issues › Use selected checkbox values in a URL › Reply To: Use selected checkbox values in a URL
Hi Elliot,
Brilliant! Thank you for your help on this, works a treat!
Although, I had to wrap the second $value (that displays the text for the link) in the single quotes and full stops to get it to render the text correctly:
<?php
$values = get_field('regions-listed-in');
if($values)
{
foreach($values as $value)
{
echo ' <a href="http://test/inhouse1/explore/' . $value . '">' . $value . '</a>';
}
}
?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.