Home › Forums › Add-ons › Repeater Field › Repeater field elseif help › Reply To: Repeater field elseif help
Basiclally i have a php script which is this:
<?php // Simple browser and OS detection script. // This will not work if User Agent is false. $agent = $_SERVER['HTTP_USER_AGENT']; // Detect Device/Operating System if(preg_match('/Linux/i',$agent)) $os = 'Linux'; elseif(preg_match('/Mac/i',$agent)) $os = 'Mac'; elseif(preg_match('/iPhone/i',$agent)) $os = 'iPhone'; elseif(preg_match('/iPad/i',$agent)) $os = 'iPad'; elseif(preg_match('/Droid/i',$agent)) $os = 'Droid'; elseif(preg_match('/Unix/i',$agent)) $os = 'Unix'; elseif(preg_match('/Windows/i',$agent)) $os = 'Windows'; else $os = 'Unknown'; ?>
so i was going to use a repeater field to and create a sub field called:
Windows and another called: Linux and another called Macosx so if on a Windows it displays the Windows field. and if on a Linux computer it shows hte Linux Field etc.
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!
🚀 This week’s session of ACF Chat Fridays dips into the preliminary results of our first ever user survey. Don’t miss it! https://t.co/3UtvQbDwNm pic.twitter.com/kMwhaJTkZc— Advanced Custom Fields (@wp_acf) May 9, 2023
© 2023 Advanced Custom Fields.