Search the Community
Showing results for tags 'vaule'.
-
I'm using a here document for the html in my php page. In it I call a function to get the correct value to pass to the form and eventually to the next php page. I'm getting an error:Array to string conversion in. I'm not sure why, maybe I'm escaping the double quotes wrong? or do you need to do something special when the value being submitted is an array? This line is where the error is, the second table data in the first table row <td><input name="choice" type="radio" value=\"getCardValues($pyramid, 0,0)\" /></td> in here $output =<<< _HTML_ <!DOCTYPE html> <html> <head> <title>Pyramid Solitaire</title> </head> <body> <div class="main"> <h1>Rock Paper Scissors Game</h1> <form action="rps.php" method="post"> <input type="text" name="name"> <input type="hidden" name="past" value="0"> <table width="20%"> <tr> <td><img src="./images/cards/getCardFile($pyramid, 0,0)" width="100" height="100" /></td> <td><input name="choice" type="radio" value=\"getCardValues($pyramid, 0,0)\" /></td> </tr> for($i = 0; $i < 2; $i++) { <tr> <td><img src="./images/cards/getCardFile($pyramid, 1,$i)" width="100" height="100" /></td> <td><input name="choice" type="radio" value="getCardValues($pyramid, 1,$i)" /></td> </tr> } and so on... This is the function being called: function getCardValues($array, $row, $col) { $valuesHolder = array($array[$row][$col].getFace(), $array[$row][$col].getSuit()); return $valuesHolder; }
- 5 replies
-
- here document
- vaule
-
(and 1 more)
Tagged with: