PHP

What Is Protected Access Modifier In PHP?

The protected access modifier is used in Inheritance principal. Any function or variable prefixed with protected modifier can only be accessed within child/sub classes. In other words they can not be accessed outside the parent child classes relationship.

Posted in: PHP, Solutions

What Is Private Access Modifier In PHP?

Any function or variable which is prefixed with private access modifier in a class, that function/variable can only be accessed/available/visible inside that class and can not be accessed/called outside a class or in another classes.

Posted in: PHP, Solutions

What Is Public Access Modifier In PHP?

The public access modifier is used inside PHP classes. The public access modifier can be prefixed with variables and functions in PHP. Any variable or function which is prefixed with public access modifier that variable or function becomes available anywhere such as it can be accessed outside a class or can be accessed in another […]

Posted in: PHP, Solutions

Get Multiple Checked Checkboxes Values In PHP

Example: <!Doctype html> <body> <?php if(isset($_POST[‘submit’])){ if(!empty($_POST[‘check_languages’])){ foreach($_POST[‘check_languages’] as $selected_value){ echo $selected_value . ” </br>”; } } } ?> <form action=”” method=”post”> <input type=”checkbox” name=”check_languages[]” value=”Asp.NET”>Asp.NET<br/> <input type=”checkbox” name=”check_languages[]” value=”Oracle”>Oracle<br/> <input type=”checkbox” name=”check_languages[]” value=”PHP”>PHP<br/> <input type=”submit” name=”submit” value=”Submit”/> </form> </body>

Posted in: HTML, PHP, Solutions

How To Get Values Of Radio Buttons In PHP?

Example: <!Doctype html> <body> <?php if(isset($_POST[‘btn_submit’])) echo “It is “. $_POST[‘sel_lang’]; ?> <h3>Your favourite programming language?</h3> <form method=”post” action=””> <input type=”radio” name=”sel_lang” value=”Php”> PHP <input type=”radio” name=”sel_lang” value=”JQuery”> JQuery <br/> <input type=”submit” name=”btn_submit” value=”Submit”> </form> <body>

Posted in: HTML, PHP, Solutions

What Is The @ Symbol In PHP?

It suppresses different error messages thrown by PHP’s functions, variables and include calls and constants etc. @ Symbol can not be used with classes, class functions, control statements such as if_else,for,while,switch,foreach statements etc. When @ symbol is prefixed with any function or variable it hides the errors and displays a custom error message by using die() function.

Posted in: PHP, Solutions

How To Get The Full URL Path In PHP?

Example: <?php $current_path = “http://$_SERVER[SERVER_NAME]$_SERVER[REQUEST_URI]”; echo $current_path; ?>

Posted in: PHP, Solutions

How To Create Class Constructor In PHP?

Example: <?php class Test_class { // Private field declaration private $Website_Name; // Constructor declaration function __construct($website_name){ $this->Website_Name = $website_name; } // Public return type function/method declaration public function get_site_name(){ return $this->Website_Name; } } // Object creation along with constructor calling $test_class = new Test_class(“Tutorialstown.com”); echo “Website is: ” . $test_class->get_site_name(); ?>

Posted in: PHP, Solutions
Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .