<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: RKadriu</title>
    <description>The latest articles on DEV Community by RKadriu (@rkadriu).</description>
    <link>https://dev.to/rkadriu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1455262%2F783076e4-9802-4f30-be10-ee5c5d46ff3f.jpg</url>
      <title>DEV Community: RKadriu</title>
      <link>https://dev.to/rkadriu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rkadriu"/>
    <language>en</language>
    <item>
      <title>Advice Needed: How Do I Succeed as a First-Time Intern?</title>
      <dc:creator>RKadriu</dc:creator>
      <pubDate>Sun, 31 Aug 2025 22:03:34 +0000</pubDate>
      <link>https://dev.to/rkadriu/first-time-as-an-intern-how-do-you-make-the-most-of-it-1244</link>
      <guid>https://dev.to/rkadriu/first-time-as-an-intern-how-do-you-make-the-most-of-it-1244</guid>
      <description>&lt;p&gt;&lt;strong&gt;Hi Dev Community&lt;/strong&gt; 👋&lt;/p&gt;

&lt;p&gt;I just started my very first internship, and I’ll be here for about two months. The company’s platform is pretty big and complex, and honestly, I’m feeling a little overwhelmed 🤯 Since this is my first real-world experience, I don’t want to just “pass time”, I want to really make the most out of this opportunity, learn as much as possible, and contribute in a meaningful way.&lt;/p&gt;

&lt;p&gt;For those of you who have been interns before (or mentored interns), I’d love to hear: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How did you structure your learning during the internship?&lt;/li&gt;
&lt;li&gt;What helped you balance between asking questions vs. figuring things out yourself?&lt;/li&gt;
&lt;li&gt;What’s the best way to make an impact in such a short time?&lt;/li&gt;
&lt;li&gt;Any common mistakes I should avoid?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I really want to make this journey meaningful, so any tips, stories, or lessons learned from your own experience would be super super helpful 🙂&lt;/p&gt;

&lt;p&gt;Thanks in advance 😊&lt;/p&gt;

</description>
      <category>internship</category>
      <category>advice</category>
      <category>career</category>
      <category>learning</category>
    </item>
    <item>
      <title>Beginner's Guide to CRUD Operations in PHP</title>
      <dc:creator>RKadriu</dc:creator>
      <pubDate>Sat, 08 Jun 2024 14:54:25 +0000</pubDate>
      <link>https://dev.to/rkadriu/mastering-crud-operations-with-php-and-mysql-51gh</link>
      <guid>https://dev.to/rkadriu/mastering-crud-operations-with-php-and-mysql-51gh</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;PHP is a flexible and widely-used server-side scripting language that powers many of the dynamic and interactive web pages we see today. As a beginner myself, I find the journey of learning PHP both challenging and rewarding. In this post, we will explore more advanced topics in PHP, building upon the basics covered in my previous post.&lt;/p&gt;

&lt;p&gt;If you haven't read my first post, &lt;a href="https://dev.to/rkadriu/php-basics-a-brief-introduction-for-beginners-4l15"&gt;PHP Primer: A Beginner's Guide&lt;/a&gt;, I highly recommend checking it out. It covers the fundamentals of PHP, including setting up your development environment, understanding basic syntax, and working with variables and data types.&lt;/p&gt;

&lt;p&gt;As we dive deeper into PHP, I welcome any feedback, suggestions, or corrections. Your comments not only help me improve but also create a collaborative learning environment for all readers. Let's continue our PHP journey together!&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up a MySQL Database
&lt;/h2&gt;

&lt;p&gt;Before we start coding, we need to set up a MySQL database. If you have XAMPP installed, you're already halfway there!&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring MySQL in XAMPP
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Open XAMPP Control Panel:&lt;/strong&gt; Launch the XAMPP control panel and start the "Apache" and "MySQL" services.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Open XAMPP Control Panel:&lt;/strong&gt; Launch the XAMPP control panel and start the "Apache" and "MySQL" services.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create a Database:&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Click on the "New" button on the left sidebar.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Enter a name for your database and click "Create."&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is another alternative option of creating database by writing &lt;code&gt;CREATE DATABASE database_name;&lt;/code&gt; command in SQL script and then click Go command.&lt;/p&gt;

&lt;p&gt;These steps are shown below with images. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ev5cvwzclv9x7m18wyl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ev5cvwzclv9x7m18wyl.png" alt="Start the PHP and MySQL server with XAMPP"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffpvxja0jn7wvaz1qkopc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffpvxja0jn7wvaz1qkopc.png" alt="Open MySQL in XAMPP"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First option of creating a database: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx8mzs6e7r3smsm95zqyj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx8mzs6e7r3smsm95zqyj.png" alt="Create new database"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Creating a database using MySQL command on SQL script:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb9icq7yxueu2l6tdj2ob.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb9icq7yxueu2l6tdj2ob.png" alt="Create new database by using MySQL command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating Tables Using phpMyAdmin
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Select Your Database: Click on the database you just created.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a Table:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Enter a name for your table (e.g., &lt;strong&gt;users&lt;/strong&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Specify the number of columns and click "Go."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Define the columns (e.g., &lt;strong&gt;id, name, email, age&lt;/strong&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Or by using MySQL commands in SQL script&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

CREATE TABLE users (
    id INT(11) PRIMARY KEY AUTO_INCREMENT NOT NULL, 
    name VARCHAR(50) NOT NULL,
    email VARCHAR(50) NOT NULL UNIQUE,
    age INT(3) NOT NULL
)


``` and then click Go.

## Connecting PHP to MySQL

Using 'mysqli' to Connect to MySQL

Updated code below
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&amp;lt;?php&lt;/p&gt;

&lt;p&gt;// Specifies the hostname of the MySQL server.&lt;br&gt;
$servername = "localhost";&lt;/p&gt;

&lt;p&gt;// The MySQL username. "root" is the default administrative username for MySQL.&lt;br&gt;
$username = "root";&lt;/p&gt;

&lt;p&gt;// The MySQL password for the specified user. It is empty ("") by default for the root user in many local development environments.&lt;br&gt;
$password = "";&lt;/p&gt;

&lt;p&gt;// The name of the database you want to connect to.&lt;br&gt;
$dbname = "php_project";&lt;/p&gt;

&lt;p&gt;// Create connection&lt;br&gt;
$conn = mysqli_connect($servername, $username, $password, $dbname);&lt;/p&gt;

&lt;p&gt;// Check connection&lt;br&gt;
if (!$conn) {&lt;br&gt;
    // Log the error and display a generic message to the user&lt;br&gt;
    error_log("Connection failed: " . mysqli_connect_error());&lt;br&gt;
    die("Connection failed. Please try again later.");&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;// If the connection is successful, display or log a success message&lt;br&gt;
echo "Connected successfully";&lt;/p&gt;

&lt;p&gt;// Close the connection (optional, as it will close when the script ends)&lt;br&gt;
mysqli_close($conn);&lt;/p&gt;

&lt;p&gt;?&amp;gt;&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

## Performing CRUD Operations

Performing CRUD operations in the context of web development refers to the basic operations that can be performed on data stored in a database: Create, Read, Update, and Delete. These operations are fundamental to building dynamic and interactive web applications where users can interact with data. CRUD operations are the backbone of database interactions in web applications. PHP allows you to perform these operations easily by defining variables that contain SQL code and executing them using PHP's database interaction libraries like MySQLi

### Create: Inserting Data

Updated code ↓
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&amp;lt;?php&lt;br&gt;
// Set a value for each variable. Variables type of values should be same as set in database&lt;br&gt;
$name = "person1";&lt;br&gt;
$email = "&lt;a href="mailto:person1@example.com"&gt;person1@example.com&lt;/a&gt;";&lt;br&gt;
$age = 25;&lt;/p&gt;

&lt;p&gt;// Prepare the SQL statement&lt;br&gt;
$stmt = mysqli_prepare($conn, "INSERT INTO users (name, email, age) VALUES ($name, $email, $age)");&lt;/p&gt;

&lt;p&gt;// Bind parameters to the prepared statement&lt;br&gt;
mysqli_stmt_bind_param($stmt, "ssi", $name, $email, $age);&lt;/p&gt;

&lt;p&gt;// Execute the prepared statement&lt;br&gt;
if (mysqli_stmt_execute($stmt)) {&lt;br&gt;
    echo "New record created successfully ";&lt;br&gt;
} else {&lt;br&gt;
    // Log the error for debugging purposes&lt;br&gt;
    error_log("Error: " . mysqli_stmt_error($stmt));&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Display a generic error message to the user
echo "An error occurred while creating the record. Please try again later.";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;// Close the prepared statement&lt;br&gt;
mysqli_stmt_close($stmt);&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
### Read: Fetching Data

The Read operation is used to fetch data from a database. This is typically done using the SELECT statement in SQL. Here's a step-by-step code and explanation of how to perform a read operation in PHP:

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;// Create an SQL query&lt;br&gt;
$sql = "SELECT id, name, email, age FROM users";&lt;br&gt;
$result = mysqli_query($conn, $sql);&lt;/p&gt;

&lt;p&gt;// Check if there are any results&lt;br&gt;
if (mysqli_num_rows($result) &amp;gt; 0) {&lt;br&gt;
    // Fetch and output data of each row&lt;br&gt;
    while($row = mysqli_fetch_assoc($result)) {&lt;br&gt;
        echo "id: " . $row["id"]. " - Name: " . $row["name"]. " - Email: " . $row["email"]. " - Age: " . $row["age"]. "&lt;br&gt;";&lt;br&gt;
    }&lt;br&gt;
} else {&lt;br&gt;
    echo "0 results";&lt;br&gt;
}&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
### Update: Modifying Data

Have you ever needed to modify existing data in a database? How did you approach it?
The update operation in PHP is used to modify existing records in a MySQL database. This is essential for maintaining accurate and current data within your application. For instance, if a user's information changes, such as their email address or age, you would use the update operation to reflect these changes in your database.

Updated code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&amp;lt;?php&lt;br&gt;
// Assuming you already have a connection established in $conn&lt;/p&gt;

&lt;p&gt;$newAge = 32;&lt;br&gt;
$email = '&lt;a href="mailto:person1@example.com"&gt;person1@example.com&lt;/a&gt;';&lt;/p&gt;

&lt;p&gt;// Prepare an SQL statement&lt;br&gt;
$stmt = mysqli_prepare($conn, "UPDATE users SET age=$newAge WHERE email=$email");&lt;/p&gt;

&lt;p&gt;if ($stmt) {&lt;br&gt;
    // Bind parameters to the prepared statement&lt;br&gt;
    mysqli_stmt_bind_param($stmt, "is", $newAge, $email);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Execute the prepared statement
if (mysqli_stmt_execute($stmt)) {
    echo "Record updated successfully";
} else {
    // Log the error internally, do not display it to the user
    error_log("Error executing statement: " . mysqli_stmt_error($stmt));
    echo "An error occurred while updating the record. Please try again later.";
}

// Close the statement
mysqli_stmt_close($stmt);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;} else {&lt;br&gt;
    // Log the error internally, do not display it to the user&lt;br&gt;
    error_log("Error preparing statement: " . mysqli_error($conn));&lt;br&gt;
    echo "An error occurred. Please try again later.";&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;// Close the connection&lt;br&gt;
mysqli_close($conn);&lt;br&gt;
?&amp;gt;&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Based on the code written above, if the process of Update goes right we'll get the message "Record updated successfully", in this case the age value of the user with the specified email will change to 32 and we can see the results in our database.

### Delete: Removing Data

The delete operation in PHP is used to remove records from a database table. This operation is performed using the SQL DELETE statement, which specifies the conditions under which records should be deleted. The syntax of the DELETE statement allows you to specify one or more conditions to ensure that only the intended records are removed from the database.

Updated code
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&amp;lt;?php&lt;/p&gt;

&lt;p&gt;$email = '&lt;a href="mailto:person3@example.com"&gt;person3@example.com&lt;/a&gt;';&lt;/p&gt;

&lt;p&gt;// Prepare an SQL statement&lt;br&gt;
$stmt = mysqli_prepare($conn, "DELETE FROM users WHERE email=$email");&lt;/p&gt;

&lt;p&gt;if ($stmt) {&lt;br&gt;
    // Bind parameter to the prepared statement&lt;br&gt;
    mysqli_stmt_bind_param($stmt, "s", $email);&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Execute the prepared statement
if (mysqli_stmt_execute($stmt)) {
    // Verify if any records were deleted using mysqli_stmt_affected_rows
    if (mysqli_stmt_affected_rows($stmt) &amp;gt; 0) {
        echo "Record deleted successfully";
    } else {
        echo "No record found with the specified email.";
    }
} else {
    // Log the error internally, do not display it to the user
    error_log("Error executing statement: " . mysqli_stmt_error($stmt));
    echo "An error occurred while deleting the record. Please try again later.";
}

// Close the statement
mysqli_stmt_close($stmt);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;} else {&lt;br&gt;
    // Log the error internally, do not display it to the user&lt;br&gt;
    error_log("Error preparing statement: " . mysqli_error($conn));&lt;br&gt;
    echo "An error occurred. Please try again later.";&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;// Close the connection&lt;br&gt;
mysqli_close($conn);&lt;br&gt;
?&amp;gt;&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;### Further Reading:

- [Official PHP Documentation](https://www.php.net/docs.php)
- [W3Schools PHP Tutorial] (https://www.w3schools.com/php/)


## Conclusion
CRUD operations are the backbone of database interactions in web applications. By mastering these operations, you can build dynamic and interactive applications. I'd love to hear about your experiences with CRUD operations! Share your thoughts in the comments below and let's keep the discussion going.

I want to express my sincere gratitude to each and every one of you who took the time to read this post and share your insights. Your engagement and feedback are incredibly valuable as we continue to learn and grow together.

Don't forget to check out my previous post for more foundational concepts, and feel free to leave your feedback or comments below. Thank you for joining me on this exploration of CRUD operations in PHP.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>php</category>
      <category>mysql</category>
      <category>webdev</category>
      <category>crud</category>
    </item>
    <item>
      <title>PHP Primer: A Beginner's Guide</title>
      <dc:creator>RKadriu</dc:creator>
      <pubDate>Sun, 12 May 2024 20:07:54 +0000</pubDate>
      <link>https://dev.to/rkadriu/php-basics-a-brief-introduction-for-beginners-4l15</link>
      <guid>https://dev.to/rkadriu/php-basics-a-brief-introduction-for-beginners-4l15</guid>
      <description>&lt;p&gt;In the world of web development, PHP (Hypertext Preprocessor) is a powerful server-side scripting language that is widely used to create dynamic and interactive web pages. Whether you're new to programming or looking to expand your skills, getting started with PHP can be an exciting journey. In this blog, I'll cover the basics of PHP, from understanding its syntax to handling data types.&lt;/p&gt;

&lt;h2&gt;
  
  
  1: Introduction to PHP
&lt;/h2&gt;

&lt;p&gt;In first session, let's dive into the fundamentals of PHP.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What is PHP?&lt;/strong&gt; PHP is a server-side scripting language that is embedded in HTML. It is used to create dynamic web pages and interacts with databases.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2: Setting up your environment:
&lt;/h2&gt;

&lt;p&gt;Before you start coding in PHP, you'll need to set up a development environment. You can use tools like XAMPP, MAMP, or WampServer to create a local server environment on your computer. I'm using XAMPP and found it easy to use. First step to set up environment using XAMPP is to install XAMPP and then go at the &lt;em&gt;Local Disk C:&lt;/em&gt; on (or wherever you have installed xampp folder) your computer and find &lt;em&gt;xampp folder&lt;/em&gt;. Go in and find &lt;em&gt;htdocs folder&lt;/em&gt; and inside this folder create your project folder with a new file inside fileName.php (so the file that we want to work with PHP should have the &lt;strong&gt;.php&lt;/strong&gt; extension).&lt;/p&gt;

&lt;p&gt;Example: &lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx08hg0wiivca4nhtk66c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx08hg0wiivca4nhtk66c.png" alt="Path of PHP files" width="" height=""&gt;&lt;/a&gt;&lt;br&gt;
As long as we work just with PHP and we don't use any database, to make the code inside our file work we should &lt;em&gt;Start&lt;/em&gt; Apache at the XAMPP control panel as shown in the picture below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3onxzsslltwnd8h4idfu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3onxzsslltwnd8h4idfu.png" alt="Work with XAMPP" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While working with PHP and XAMPP, it's essential to use a reliable &lt;strong&gt;code editor&lt;/strong&gt; to write and manage your PHP files. Visual Studio Code (VSCode): A lightweight yet powerful code editor with built-in support for PHP, syntax highlighting, code completion, and a vast ecosystem of extensions to enhance your development experience.&lt;/p&gt;

&lt;p&gt;To be able to run and see the output of our php file code, we have to open a browser and open &lt;em&gt;localhost/foldername/filename&lt;/em&gt; as shown below &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6d568lv30pazfhbn3tc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6d568lv30pazfhbn3tc.png" alt="Run PHP file" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  3: PHP syntax
&lt;/h2&gt;

&lt;p&gt;PHP code is enclosed within &lt;em&gt;&amp;lt;?php ?&amp;gt;&lt;/em&gt; tags. We'll explore basic syntax rules, variables, data types (such as strings, integers, floats, booleans), and basic operators (+, -, *, /, %).&lt;/p&gt;

&lt;p&gt;Here is an example of simple syntax of PHP code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php 

//Here goes PHP code
echo "My first blog"; //echo is used to print code that's inside brackets

?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4: Variables
&lt;/h2&gt;

&lt;p&gt;Variables in PHP start with a dollar sign ($) followed by the variable name (the best practice is that the variable name to be descriptive for the variable content). They are case-sensitive and can store different data types, such as strings, integers, floats, and booleans.&lt;/p&gt;

&lt;h2&gt;
  
  
  5: Data Types
&lt;/h2&gt;

&lt;p&gt;PHP supports various data types, including strings (text), integers (whole numbers), floats (decimal numbers), booleans (true or false), arrays (ordered collections of data), NULL, object and more.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
    // Define variables
    $name = "John"; // String - Descriptive variable name for the person's name 
    $age = 30; // Integer - Descriptive variable name for the person's age
    $height = 6.1; // Float - Descriptive variable name for the person's height in feet
    $is_student = true; // Boolean - Descriptive variable name indicating whether the person is a student

// Output variables
    echo "Name: $name&amp;lt;br&amp;gt;"; // Outputs: Name: John
    echo "Age: $age&amp;lt;br&amp;gt;"; // Outputs: Age: 30
    echo "Height: $height&amp;lt;br&amp;gt;"; // Outputs: Height: 6.1
    echo "Is Student: " . ($is_student ? "Yes" : "No") . "&amp;lt;br&amp;gt;"; // In this case, if _$is_student_ is true, the expression "Yes" is returned. If _$is_student_ is false, the expression "No" is returned.
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Arrays
&lt;/h3&gt;

&lt;p&gt;Arrays are fundamental data structures in PHP that allow you to store and manipulate collections of data. Here is a brief information about types of arrays:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Indexed array is a collection of data elements, each identified by an index or a numeric key. Elements in an indexed array are accessed using numerical indices, starting from zero. They are useful for storing lists of items where the order matters.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
    // Indexed Array
    $colors = array("Red", "Green", "Blue");

   // Accessing array elements
    echo "First color: " . $colors[0] . "&amp;lt;br&amp;gt;"; // Outputs: Red
    echo "Second color: " . $colors[1] . "&amp;lt;br&amp;gt;"; // Outputs: Green
    echo "Third color: " . $colors[2] . "&amp;lt;br&amp;gt;"; // Outputs: Blue
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Associative Array is a collection of key-value pairs, where each key is associated with a specific value. Elements in an associative array are accessed using their keys instead of numerical indices. These are useful for representing data with named attributes or properties.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
// Associative Array
    $person = array("name" =&amp;gt; "John", "age" =&amp;gt; 30, "city" =&amp;gt; "New York");

    // Accessing associative array elements
    echo "Name: " . $person["name"] . "&amp;lt;br&amp;gt;"; // Outputs: John
    echo "Age: " . $person["age"] . "&amp;lt;br&amp;gt;"; // Outputs: 30
    echo "City: " . $person["city"] . "&amp;lt;br&amp;gt;"; // Outputs: New York`
?&amp;gt;
- Multidimensional Array is an array that contains one or more arrays as its elements. Each element of a multidimensional array can be an indexed array, an associative array, or another multidimensional array. These are useful for representing complex data structures, such as matrices or tables.
`
&amp;lt;?php
// Multidimensional Array
    $students = array(
        array("name" =&amp;gt; "Alice", "age" =&amp;gt; 25),
        array("name" =&amp;gt; "Bob", "age" =&amp;gt; 28),
        array("name" =&amp;gt; "Charlie", "age" =&amp;gt; 30)
    );

    // Accessing multidimensional array elements
    echo "Student 1: " . $students[0]["name"] . ", Age: " . $students[0]["age"] . "&amp;lt;br&amp;gt;"; // Outputs: Student 1: Alice, Age: 25
    echo "Student 2: " . $students[1]["name"] . ", Age: " . $students[1]["age"] . "&amp;lt;br&amp;gt;"; // Outputs: Student 2: Bob, Age: 28
    echo "Student 3: " . $students[2]["name"] . ", Age: " . $students[2]["age"] . "&amp;lt;br&amp;gt;"; // Outputs: Student 3: Charlie, Age: 30
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  6: Basic Operators
&lt;/h2&gt;

&lt;p&gt;PHP supports standard arithmetic operators (+, -, *, /, %), assignment operators (=, +=, -=), comparison operators (==, !=, &amp;gt;, &amp;lt;, &amp;gt;=, &amp;lt;=), and logical operators (&amp;amp;&amp;amp;, ||, !).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
    // Arithmetic Operators
    $num1 = 10;
    $num2 = 5;

    $sum = $num1 + $num2; // Addition
    $difference = $num1 - $num2; // Subtraction
    $product = $num1 * $num2; // Multiplication
    $quotient = $num1 / $num2; // Division
    $remainder = $num1 % $num2; // Modulus

    echo "Sum: $sum&amp;lt;br&amp;gt;"; // Outputs: 15
    echo "Difference: $difference&amp;lt;br&amp;gt;"; // Outputs: 5
    echo "Product: $product&amp;lt;br&amp;gt;"; // Outputs: 50
    echo "Quotient: $quotient&amp;lt;br&amp;gt;"; // Outputs: 2
    echo "Remainder: $remainder&amp;lt;br&amp;gt;"; // Outputs: 0

    // Assignment Operators
    $x = 10;
    $x += 5; // Equivalent to: $x = $x + 5;
    echo "Value of x after addition: $x&amp;lt;br&amp;gt;"; // Outputs: 15

    $y = 20;
    $y -= 8; // Equivalent to: $y = $y - 8;
    echo "Value of y after subtraction: $y&amp;lt;br&amp;gt;"; // Outputs: 12

    // Comparison Operators
    $a = 10;
    $b = 5;

    $isEqual = ($a == $b); // Equal
    $isNotEqual = ($a != $b); // Not Equal
    $isGreaterThan = ($a &amp;gt; $b); // Greater Than
    $isLessThan = ($a &amp;lt; $b); // Less Than
    $isGreaterOrEqual = ($a &amp;gt;= $b); // Greater Than or Equal To
    $isLessOrEqual = ($a &amp;lt;= $b); // Less Than or Equal To

    var_dump($isEqual); // Outputs: bool(false)
    var_dump($isNotEqual); // Outputs: bool(true)
    var_dump($isGreaterThan); // Outputs: bool(true)
    var_dump($isLessThan); // Outputs: bool(false)
    var_dump($isGreaterOrEqual); // Outputs: bool(true)
    var_dump($isLessOrEqual); // Outputs: bool(false)

    // Logical Operators
    $isTrue = true;
    $isFalse = false;

    $logicalAnd = ($isTrue &amp;amp;&amp;amp; $isFalse); // Logical AND
    $logicalOr = ($isTrue || $isFalse); // Logical OR
    $logicalNot = !$isTrue; // Logical NOT

    var_dump($logicalAnd); // Outputs: bool(false)
    var_dump($logicalOr); // Outputs: bool(true)
    var_dump($logicalNot); // Outputs: bool(false)
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;From understanding the fundamental concepts of PHP to setting up a development environment and exploring key language features such as variables, data types, arrays, and operators, we've covered essential ground.&lt;/p&gt;

</description>
      <category>php</category>
      <category>programming</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
