Jump to content

array returning "Array" ?


henricar

Recommended Posts

Hey guys, I am using multiple inputs (checkboxes) to pass values to another page (I have named them name="blabla[]" in order to pass the values an as array). The problem is when I print_r the array, I get "Array" as a result... I have tried imploding it to a string but it doesn't seem to be working. Any ideas on what could be causing this?

 

Thank you

Link to comment
Share on other sites

sure, field markup is:

<form action="index.php?p=dosuggtag" method="POST"><input type="hidden" name="sid" value="'. $suggestionid .'">
                                                                                                            <b>Suggested Tags:</b> '; while ($i < count($tagarray)) {
                                                                                                                                        echo '<input type="checkbox" name="tags[]" value="'. $tagarray[$i] .'">';
                                                                                                                                        echo $tagarray[$i];
                                                                                                                                        echo ' ';
                                                                                                                                        
                                                                                                                                        $i++;
                                                                                                            }
                                                                                                           
                                                                                                                                    echo'
                                                                                                        </td>
                                                                                                    </tr>
                                                                                                    <tr>
                                                                                                        <td width="100%" align="left">
                                                                                                            <input type="submit" value="Update Tags">
                                                                                                        </td></form>

 

and code to process the array is:

$suggtagarray = $_POST['tags'];
print_r ($suggtagarray);

 

 

Link to comment
Share on other sites

sorry about that I meant array! this is what I get when I look at the source:

<input type="checkbox" name="tags[]" value="bla">bla <input type="checkbox" name="tags[]" value="csd">csd <input type="checkbox" name="tags[]" value="sfvdk">sfvdk 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.