Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9078147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:32:52+00:00 2026-06-16T19:32:52+00:00

I have this PHP/HTML code: <table> <tr> <td>Region:</td> <td> <select style=width:200px name=region> <?php for(

  • 0

I have this PHP/HTML code:

<table>                                                                                        
  <tr>
    <td>Region:</td>
    <td>
      <select style="width:200px" name="region"> 
      <?php for( $i=0;$i<sizeof($regions);$i++) { ?>
      <option value=<?php echo($regions[$i]) ;?>><?php echo( $regions[$i]) ;?></option> 
      <?php }?>
      </select>  
    </td>
</tr>

The problem is the value displayed is ( Array ). I tried to replace echo by printf and sprintf but I have the same result. But if I replaced it with print_r I now have this information (Array ([0] => Alaska[region] => Alaska).

I need to know what I’m doing wrong and how can I fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T19:32:53+00:00Added an answer on June 16, 2026 at 7:32 pm

    If you get Array as your output, then you’re actually doing something like:

    $x = array();
    echo $x;
    

    e.g. you’re not outputting an ELEMENT of an array, you’re trying to output the entire array.

    That means $regions[$i] is itself an array, and you need a sub-index, e.g. $regions[$i][1] instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this HTML code to create the form: <form method=POST action=/post.php name=signup> <table>
I have several like this in my HTML code: <input class=table type=checkbox name=interest[] value=finger
I have this code snippet in an email layout: <div> <?php echo $this->Html->image('Layouts/default/Logo.png', array(
I have a line of php code that looks like this: echo <script>$('#edit_errors').html('<h3><em>Please Correct
i have this code file search.php <html> <head> <script src=http://code.jquery.com/jquery-1.8.3.js></script> <script src=http://code.jquery.com/ui/1.9.2/jquery-ui.js></script> <script> </script>
I have this html code: <tr> <td><label><input type=text name=id class=DEPENDS ON info BEING student
I have this code for form submit: index.php <html> <head> <title>My Form</title> <script type=text/javascript
I have a .php file with HTML code also in it. Through this file
So I have this simple PHP loop that is generating html table data with
I have a table in MYSQL that looks like this (notice the html code)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.