John Davidson

php - 'Notice: Array to string conversion in...' error

0 comments
Message:


I have a PHP file that tries to echo a $_POST and I get an error, here is the code:



echo "<html>";
echo "<body>";
for($i=0; $i<5;$i++){
echo "<input name='C[]' value='$Texting[$i]' " .
"style='background-color:#D0A9F5;'></input>";

}
echo "</body>";
echo "</html>";
echo '<input type="submit" value="Save The Table" name="G"></input>'


Here is the code to echo the POST.



if(!empty($_POST['G'])){
echo $_POST['C'];
}


But when the code runs I get an error like:



Notice: Array to string conversion in 
C:\xampp\htdocs\PHIS\FinalSubmissionOfTheFormPHP.php on line 8


What does this error mean and how do I fix it?



My Answer:
PHP is a server-side scripting language that is commonly used for web development. It can be embedded into HTML code and is often used to create dynamic web pages and applications. PHP stands for Hypertext Preprocessor and is open-source, meaning it is free to use and modify. It is a popular choice for building websites and web applications due to its ease of use and wide range of functionality.

Rate this post

3 of 5 based on 6063 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us