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
https://forums.phpfreaks.com/topic/235138-array-returning-array/
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);

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.