Posts

Showing posts from October, 2018

How to use $GLOBALS variable in php to access global variables

Image
Access global variable in php via any function/class using $GLOBALS inside, outside of scope. Php $GLOBALS variable is used to retrieve any already declared global variable because inside php scripting programming language there are all global variables defines in $GLOBALS[index] form, So if you define any global variable in php then it will automatically set into index value and can be call through $GLOBALS[index_value] . So here is the complete step by step tutorial for How to use $GLOBALS variable in php to access global variables. How to use $GLOBALS variable in php to access global variables. Code for globals-variables.php file.  <!doctype html> <html> <head> <meta charset="utf-8"> <title>$GLOBALS variable in php to access global variables</title> </head> <body> <?php $a = 20; $b = 30; function sum() { //ACCESSING VARIABLES USING GLOBALS $GLOBALS['c'] = $GLOBALS['a'] + $GLOBALS...

Php Examples Tutorials

Image
Category Archives:   Php Examples Tutorials PHP Insert Drop Down List selected value in MySQL database   Juned Mughal   February 24, 2016 Php Examples Tutorials 0 How to store/submit drop down list selected item to phpmyadmin MySQL db using PHP script code. In this tutorial we are simply creating an html from with select name and label tags. This tags create drop down list in html. Now after that we are submitting the current drop down list… CONTINUE READING PHP Insert/Store multiple selected checkbox values in MySQL database   Juned Mughal   February 22, 2016 Php Examples Tutorials 5 How to Send multiple selected checkbox data to single row column box and separate them with comma( , ). In this tutorial we are simply submitting multiple values at a single time to MySQL database table inside single row-column box. The values can be automatically separated via comma inside table cell.… CONTINUE READING PHP Insert...