PHP
CRUD App in PHP
In this blog, you'll discover a step-by-step guide on creating a CRUD app in PHP, complete with MySQL integration. When learning a new programming language, mastering CRUD operations is fundamental. But what exactly does CRUD mean? Create Read Update Delete The first step towards this is to make[...]
PHP built-in functions
PHP comes with a vast library of built-in functions that you can use for various purposes, ranging from string manipulation, array handling, file operations, session management, and much more. Here's an overview of some of the categories of built-in functions in PHP, along with examples from each category: Name Description[...]
Associative Array Example in PHP
<?php $data = array( 'name'=>"John Doe", 'age'=>20, "company_name"=> "XYZ" ); echo $data['name']. "\n"; echo $data['age']. "\n"; echo $data['company_name']. "\n"; ?> Output: $ php associative_array.php John Doe 20 XYZ
Class and Object Example in PHP
<?php class Data { public $data; function setData($data){ $this->data = $data; } function getData(){ return $this->data; } } $data = new Data(); $data->setData( array( "name"=>"John Doe", "age"=>20, "company_name"=> "XYZ" ) ); echo json_encode($data->getData()). "\n"; $dataE1 = new Data(); $dataE1->setData( array( "name"=>"John Doe 1", "age"=>21, "company_name"=> "ABC" ) ); echo json_encode($dataE1->getData()).[...]
PHP Tutorials
<?php echo "Hello World";?> Output: Hello World Explanation: A PHP script starts with <?php and ends with ?> In PHP there are two basic ways to get the output: echo and print. <?php print "Hello World";?> Output: Hello World What is difference between echo and print? The differences are small:[...]
PHP: Arrays
In this post, we’ll talk about Arrays in PHP. What is an Array? An array stores multiple values in one single variable. An array is a special variable, which can hold more than one value at a time. If you have a list of items (a list of car names,[...]