i using this code to display radio buttons for selection. somehow the its not working correctly, plz guide on this issue. thanks in advance. <div class="register-section" id="user-role-section"> <label for="wp_rar_user_role"><?php echo $this->wp_rar_role_label; ?></label> <?php foreach($this->wp_selected_rar_roles as $role) { ?> <input type="radio" name="wp_rar_user_role" id="wp_rar_user_role" class="input select" value="<?php echo $role; ?>" /> <label> <?php echo $wp_roles->roles[$role]['name']; ?> </label> <?php } ?> </div> PHP:
Can you please tell me what you get when you print_r($this->wp-selected_rar_roles)? Also, when you say "it's not working" - what do you mean? are you not getting any inputs shown?
Then you should elaborate what the actual problem was - and writing "it's not working correctly" doesn't really help us - we can't use your code to show the same problem, since we might not have Wordpress installed, or if we do, we might not have the correct setup. And, if you've found the solution, as a courtesy for other people searching for similar solutions, you should post the solution.
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WindowsApplication2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { int[] dizi = { 5, 10, 15, 20, 25, 30 }; // int toplam=0; // foreach (int x in dizi) // {listbot.. toplam += x; // } label1.Text = “Toplamları: ” + toplam; } } } This forum Foreach cycle is described. Loops in the program, which had to be repeated statements or code blocks instead of typing again and again by typing in a single structure or code blocks of statements. In C#, Foreach cycle notation indicating a set of each element of collection or a structure for codes that are cycles that are running. (Degisken_tipi Foreach variable in array) { //code; } the variable, in order to keep the number of the elements. Foreach loop cycle provides an opportunity for us use variable. so that is what we want we want sokabiliriz processing. But we cannot work on a cycle. For example, an integer type for the variable listbox components and add to a total program that says let's take it for you.
maybe you should try to print_r($role) and see what it outputs, looks logical that you output variables from this $role array (like echo $role->something)