I'm always excited to take on new projects and collaborate with innovative minds.

Phone

+91 80824 84460

Website

https://shahidmalla.com

Address

Watergam, Baramulla Jammu and Kashmir

Whatsapp

+91 80824 84460

Social Links

Web Development

Learn PHP In Roman Urdu

Seekhiye kaysey third-party APIs ko apni PHP applications mein integrate karke powerful data access aur functionality hasil ki ja sakti hai

Learn PHP In Roman Urdu

Course Ka Khaka

  1. PHP ka Taaruf
  2. Basic Syntax & Variables
  3. Data Types aur Type Casting
  4. Strings aur Unki Manipulation
  5. Operators
  6. Control Structures (if/else, switch)
  7. Loops (for, while, do-while, foreach)
  8. Arrays (Indexed, Associative, Multidimensional)
  9. Functions
  10. Forms aur User Input ka Handle karna
  11. Superglobals (GET, POST, SERVER)
  12. Sessions aur Cookies
  13. File Handling
  14. JSON ke sath Kaam
  15. Date aur Time
  16. Error aur Exception Handling
  17. Object-Oriented Programming (OOP)
  18. Namespaces aur Autoloading
  19. Security Best Practices
  20. Database Connection (MySQL, PDO)
  21. Prepared Statements
  22. Composer ka Istemaal (Dependency Management)
  23. PHP Frameworks ka Intro (Laravel example)
  24. APIs Banana aur Consume karna
  25. Advanced Topics (Design Patterns, Caching, Performance)

1. PHP ka Taaruf

Tashreeh:
PHP ek server-side scripting language hai jisse web pages ko dynamic banaya jaata hai. Server par PHP code run hota hai aur HTML browser ko send ki jati hai.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) Home page par welcome message:

    <?php echo "Meray Online Store mein Khush Aamdeed!"; ?>
    
  2. (Real-Life) Aaj ka special product dikhana:

    <?php
    $specialProduct = "Organic Apples";
    echo "Aaj ka special: $specialProduct";
    ?>
    
  3. (Real-Life) Navigation menu ka dynamic hona:

    <?php
    $menuItems = ["Home","Shop","Contact"];
    foreach($menuItems as $item) {
      echo "<a href='#'>$item</a> ";
    }
    ?>
    
  4. (Real-Life) Login ke baad user ka naam dikhana:

    <?php
    $userName = "Alice";
    echo "Hello, $userName! Apke orders check karein?";
    ?>
    
  5. (Real-Life) Footer mein saal dikhana:

    <?php echo "&copy; " . date("Y") . " Meri Company"; ?>
    
  6. (Abstract) Simple number print:

    <?php echo 2+3; ?>
    
  7. (Abstract) String variable print karna:

    <?php
    $greeting = "Hello World";
    echo $greeting;
    ?>
    
  8. (Abstract) Conditional (har dafa run hoga):

    <?php if(true){ echo "Ye hamesha chalay ga"; } ?>
    
  9. (Abstract) Variable concatenation:

    <?php
    $city = "Paris";
    echo "I love " . $city;
    ?>
    
  10. (Abstract) PHP tags in HTML:

    <html><body><?php echo "<h1>PHP Heading</h1>"; ?></body></html>
    

2. Basic Syntax & Variables

Tashreeh:
PHP code <?php ... ?> tag mein likha jata hai. Variables $ se shuru hotay hain. Case-sensitive hain.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) User ka email store karna:

    $userEmail = "[email protected]";
    echo "User Email: $userEmail";
    
  2. (Real-Life) Price + Tax calculate karna:

    $price = 100;
    $tax = 0.08;
    $total = $price + ($price*$tax);
    echo "Total Price: $total";
    
  3. (Real-Life) Cart mein items ki tadaad:

    $cartCount = 3;
    echo "Cart mein $cartCount items hain.";
    
  4. (Real-Life) Delivery address show karna:

    $deliveryAddress = "1234 Maple Street";
    echo "Deliver hoga: $deliveryAddress";
    
  5. (Real-Life) Discount code dikhana:

    $discountCode = "SAVE20";
    echo "Code $discountCode use karein 20% off k liye!";
    
  6. (Abstract) Simple string var:

    $msg = "Hello PHP";
    echo $msg;
    
  7. (Abstract) Integers add karna:

    $x=10; $y=5;
    echo $x+$y;
    
  8. (Abstract) Variable update karna:

    $counter=1;
    $counter++;
    echo $counter;
    
  9. (Abstract) Strings concatenate:

    $firstName="John"; $lastName="Doe";
    echo $firstName." ".$lastName;
    
  10. (Abstract) Double quotes mein variable:

    $color="blue";
    echo "Sky is $color";
    

3. Data Types aur Type Casting

Tashreeh:
PHP mein strings, integers, floats, booleans, arrays, objects aur NULL hotay hain. Type casting se ek type ko doosri type mein badla ja sakta hai.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) Product price float:

    $productPrice = 19.99;
    echo "Price: $$productPrice";
    
  2. (Real-Life) Site visits integer:

    $visits=120;
    echo "Total visits: $visits";
    
  3. (Real-Life) User login boolean:

    $isLoggedIn = true;
    if($isLoggedIn) { echo "Welcome back!"; }
    
  4. (Real-Life) String se int cast (user input):

    $quantity="5";
    $quantityInt=(int)$quantity;
    echo "Aap ne $quantityInt items select kiye.";
    
  5. (Real-Life) Middle name NULL:

    $middleName=null;
    echo ($middleName===null)?"No middle name.":$middleName;
    
  6. (Abstract) gettype():

    $val=10;
    echo gettype($val);
    
  7. (Abstract) float to int cast:

    $num=3.14;
    echo (int)$num;
    
  8. (Abstract) is_string() check:

    $test="Hello";
    if(is_string($test)){ echo "It's a string!"; }
    
  9. (Abstract) is_null() check:

    $x=null;
    echo is_null($x)?"Null hai":"Null nahin";
    
  10. (Abstract) boolean to string:

    $flag=true;
    echo (string)$flag; // "1"
    

4. Strings aur Unki Manipulation

Tashreeh:
Strings characters ka silsila hain. Common operations: concatenate, length check, uppercase, replace etc.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) User ka naam format karna (capitalize):

    $first="john"; $last="doe";
    $fullName=ucfirst($first)." ".ucfirst($last);
    echo $fullName;
    
  2. (Real-Life) Product title mein keyword dhoondhna:

    $title="Organic Apple Juice";
    if(strpos($title,"Apple")!==false){ echo "Apple included!"; }
    
  3. (Real-Life) User input trim karna:

    $input="   iphone   ";
    echo trim($input);
    
  4. (Real-Life) Email mask karna:

    $email="[email protected]";
    $masked=substr($email,0,3)."****".strstr($email,"@");
    echo $masked;
    
  5. (Real-Life) Description uppercase:

    $desc="fresh organic apples";
    echo strtoupper($desc);
    
  6. (Abstract) strlen():

    echo strlen("Hello World");
    
  7. (Abstract) substr():

    echo substr("Hello World",0,5);
    
  8. (Abstract) str_replace():

    echo str_replace("World","PHP","Hello World");
    
  9. (Abstract) explode string to array:

    $words=explode(" ","Split this");
    print_r($words);
    
  10. (Abstract) implode array to string:

    $parts=["Join","me","now"];
    echo implode("-",$parts);
    

5. Operators

Tashreeh:
Arithmetic (+ - * / %), comparison (== === != > <), logical (&& || !), concatenation (.) operators use hote hain.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) Total order price calculate karna:

    $price=50; $qty=2;
    echo $price*$qty; //100
    
  2. (Real-Life) Free shipping threshold check:

    $total=120;
    if($total>=100){echo "Free shipping!";}
    
  3. (Real-Life) Age check for signup:

    $age=17;
    echo ($age>=18)?"Sign up":"Underage";
    
  4. (Real-Life) Promo code exact check:

    $promo="SAVE10";
    if($promo==="SAVE10"){echo "Promo applied!";}
    
  5. (Real-Life) Stock zero check:

    $stock=0;
    if($stock==0){echo "Out of stock.";}
    
  6. (Abstract) addition:

    echo 3+7;
    
  7. (Abstract) == vs ===:

    $a="5";$b=5;
    echo ($a==$b)?"Equal":"Not Equal"; //Equal
    echo ($a===$b)?"Identical":"Not Identical"; //Not Identical
    
  8. (Abstract) Logical AND:

    if(10>0 && 5>0){echo "Both positive";}
    
  9. (Abstract) Logical OR:

    $color="red";
    if($color=="red"||$color=="blue"){echo "Primary color";}
    
  10. (Abstract) Remainder:

    echo 10%3; //1
    

6. Control Structures (if/else, switch)

Tashreeh:
if/else conditions logic ko branch karte hain. switch multiple conditions ko handle karta hai.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) Admin check:

    $role="admin";
    if($role=="admin"){echo "Welcome admin!";}
    
  2. (Real-Life) Discount apply ya nahin:

    $total=200;
    if($total>100){echo "Discount applied!";}else{echo "No discount.";}
    
  3. (Real-Life) Payment method switch:

    $payment="credit_card";
    switch($payment){
      case "credit_card": echo "Credit card process..."; break;
      case "paypal":echo "PayPal process..."; break;
      default:echo "Not supported.";
    }
    
  4. (Real-Life) Location based delivery:

    $location="International";
    if($location=="Local"){echo "2 days delivery";}else{echo "International shipping";}
    
  5. (Real-Life) Subscription level check:

    $sub="gold";
    if($sub=="gold"){echo "Premium features unlocked!";}
    
  6. (Abstract) Simple if:

    $x=5;if($x>0){echo "Positive";}
    
  7. (Abstract) if/else:

    $y=10;
    if($y>10){echo "Greater";}else{echo "Not greater";}
    
  8. (Abstract) if/elseif/else:

    $num=0;
    if($num>0){echo "Positive";}elseif($num<0){echo "Negative";}else{echo "Zero";}
    
  9. (Abstract) Switch with color:

    $c="blue";
    switch($c){case"red":echo"Red";break;case"blue":echo"Blue";break;default:echo"Other";}
    
  10. (Abstract) Nested if:

    $a=4;if($a>0){if($a<5){echo"Between 1-4";}}
    

7. Loops (for, while, do-while, foreach)

Tashreeh:
Loops repeat code blocks. foreach arrays k liye, for aur while condition based iteration k liye use hotay hain.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) Top-selling products list:

    $products=["Laptop","Phone","Tablet"];
    foreach($products as $p){echo $p."<br>";}
    
  2. (Real-Life) Sale start countdown:

    $days=5;
    while($days>0){echo "Sale in $days days<br>";$days--;}
    
  3. (Real-Life) Order IDs print:

    $orderIds=[1001,1002,1003];
    foreach($orderIds as $id){echo "Order ID: $id<br>";}
    
  4. (Real-Life) Stock levels show:

    $inventory=["Apple"=>50,"Banana"=>0];
    foreach($inventory as $item=>$qty){echo "$item: $qty<br>";}
    
  5. (Real-Life) Subscribers ko reminder:

    $emails=["[email protected]","[email protected]"];
    for($i=0;$i<count($emails);$i++){echo "Reminder to: ".$emails[$i]."<br>";}
    
  6. (Abstract) Simple for:

    for($i=1;$i<=5;$i++){echo $i;}
    
  7. (Abstract) while loop:

    $x=1;while($x<=3){echo$x;$x++;}
    
  8. (Abstract) do-while:

    $y=0;do{echo$y;$y++;}while($y<3);
    
  9. (Abstract) foreach array:

    $arr=[10,20,30];
    foreach($arr as $val){echo$val;}
    
  10. (Abstract) break loop:

    for($i=0;$i<10;$i++){if($i==5)break;echo$i;}
    

8. Arrays (Indexed, Associative, Multidimensional)

Tashreeh:
Arrays multiple values store karte hain. Associative arrays keys ke sath. Multidimensional arrays arrays ke andar array.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) Product names list:

    $products=["Keyboard","Mouse","Monitor"];
    echo $products[0];
    
  2. (Real-Life) Product prices associative:

    $prices=["Keyboard"=>29.99,"Mouse"=>9.99];
    echo $prices["Mouse"];
    
  3. (Real-Life) Users data multidimensional:

    $users=[["name"=>"Alice","email"=>"[email protected]"],["name"=>"Bob","email"=>"[email protected]"]];
    echo $users[1]["email"];
    
  4. (Real-Life) Categories and products:

    $categories=["Fruits"=>["Apple","Banana"],"Veg"=>["Carrot","Lettuce"]];
    echo $categories["Fruits"][0];
    
  5. (Real-Life) Shopping cart (item=>qty):

    $cart=["item1"=>2,"item2"=>3];
    echo $cart["item1"];
    
  6. (Abstract) Simple array:

    $nums=[1,2,3];
    echo $nums[2];
    
  7. (Abstract) Add element:

    $arr=[];$arr[]="Hello";print_r($arr);
    
  8. (Abstract) count array elements:

    $arr=["A","B","C"];
    echo count($arr);
    
  9. (Abstract) array_merge():

    $a1=[1,2];$a2=[3,4];
    print_r(array_merge($a1,$a2));
    
  10. (Abstract) in_array():

    $colors=["red","green","blue"];
    if(in_array("green",$colors)){echo"Found green";}
    

9. Functions

Tashreeh:
Functions reusable code blocks hain. Parameters le sakti hain, value return kar sakti hain.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) Tax ke sath total:

    function totalWithTax($price){$tax=0.08;return$price+($price*$tax);}
    echo totalWithTax(100);
    
  2. (Real-Life) Full name format:

    function formatName($f,$l){return ucfirst($f)." ".ucfirst($l);}
    echo formatName("jane","doe");
    
  3. (Real-Life) Stock check function:

    function isInStock($qty){return$qty>0;}
    echo isInStock(5)?"In stock":"Out";
    
  4. (Real-Life) Welcome message:

    function welcomeMessage($user){return"Hello $user";}
    echo welcomeMessage("Alice");
    
  5. (Real-Life) Apply discount coupon:

    function applyDiscount($total,$code){if($code=="SAVE10"){return$total*0.9;}return$total;}
    echo applyDiscount(200,"SAVE10");
    
  6. (Abstract) Simple add:

    function add($a,$b){return$a+$b;}
    echo add(2,3);
    
  7. (Abstract) No return function:

    function greet(){echo"Hello!";}
    greet();
    
  8. (Abstract) Default parameter:

    function multiply($a,$b=2){return$a*$b;}
    echo multiply(5);
    
  9. (Abstract) Array as argument:

    function printArray($arr){foreach($arr as $i){echo $i." ";}}
    printArray(["X","Y","Z"]);
    
  10. (Abstract) Type declarations:

    function sumIntegers(int$x,int$y):int{return$x+$y;}
    echo sumIntegers(4,5);
    

10. Forms aur User Input

Tashreeh:
Forms se data GET/POST mein aata hai. $_GET aur $_POST se access karein, phir sanitize karein.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) Login form process (POST):

    if($_SERVER['REQUEST_METHOD']==='POST'){
      $username=$_POST['username'];
      echo "Welcome, $username";
    }
    
  2. (Real-Life) Product search (GET):

    $query=$_GET['q']??'';
    echo "Search: $query";
    
  3. (Real-Life) Contact form input sanitize:

    $name=htmlspecialchars($_POST['name']);
    $msg=htmlspecialchars($_POST['message']);
    echo "Shukriya $name, message received.";
    
  4. (Real-Life) Dropdown category:

    $category=$_POST['category'];
    echo "Selected: $category";
    
  5. (Real-Life) File upload:

    if(isset($_FILES['image'])){
      move_uploaded_file($_FILES['image']['tmp_name'],"uploads/".$_FILES['image']['name']);
      echo "File uploaded!";
    }
    
  6. (Abstract) Default GET page:

    $page=$_GET['page']??1;
    echo "Page: $page";
    
  7. (Abstract) Form submitted check:

    if(!empty($_POST)){echo"Form submitted!";}
    
  8. (Abstract) filter_var():

    $data=filter_var($_POST['data'],FILTER_SANITIZE_STRING);
    echo $data;
    
  9. (Abstract) Validate integer:

    $num=filter_input(INPUT_GET,'num',FILTER_VALIDATE_INT);
    if($num!==false){echo"Valid number";}
    
  10. (Abstract) Empty field check:

    $field=$_POST['field']??'';
    if(trim($field)==''){echo"Field empty";}
    

11. Superglobals (GET, POST, SERVER)

Tashreeh:
$_GET aur $_POST form data hold karte hain. $_SERVER server info deta hai.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) $_GET['product_id'] se product page load
  2. (Real-Life) $_POST['password'] login ke liye
  3. (Real-Life) $_SERVER['HTTP_USER_AGENT'] browser detect karne ke liye
  4. (Real-Life) $_SERVER['REMOTE_ADDR'] se user IP log karna
  5. (Real-Life) $_SERVER['REQUEST_METHOD'] se pata GET/POST
  6. (Abstract) $_GET['page'] pagination ke liye
  7. (Abstract) $_POST['comment'] feedback form
  8. (Abstract) $_SERVER['PHP_SELF'] current script ka naam
  9. (Abstract) $_SERVER['SERVER_NAME'] server ka naam
  10. (Abstract) $_SERVER['REQUEST_URI'] request path

12. Sessions aur Cookies

Tashreeh:
Session server par data store karta hai, cookies client browser mein. Dono se user state maintain ki jati hai.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) Login ke baad session mein user_id store
  2. (Real-Life) Cookie se user ki theme preference yaad rakhna
  3. (Real-Life) Cart data session mein
  4. (Real-Life) Cookie se last visited page yaad rakhna
  5. (Real-Life) CSRF token session mein store karna
  6. (Abstract) session_start(); $_SESSION['count']=1;
  7. (Abstract) Session variable check karna isset($_SESSION['count'])
  8. (Abstract) Cookie set karna setcookie("name","value",time()+3600);
  9. (Abstract) session_destroy() session khatam karne ke liye
  10. (Abstract) Secure cookie set karna (HTTPS only)

13. File Handling

Tashreeh:
Files read/write, upload aur delete kiye ja sakte hain.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) User feedback ko file mein likhna
  2. (Real-Life) Error log file mein store karna
  3. (Real-Life) CSV se product data read karna
  4. (Real-Life) User profile pic upload
  5. (Real-Life) PDF invoice generate (advanced)
  6. (Abstract) fopen(), fread(), fclose()
  7. (Abstract) file_get_contents("file.txt")
  8. (Abstract) file_put_contents("file.txt","Hello")
  9. (Abstract) file_exists("file.txt") check
  10. (Abstract) unlink("file.txt") delete

14. JSON ke sath Kaam

Tashreeh:
JSON data exchange ke liye common hai. json_encode() aur json_decode() use hotay hain.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) Products array ko JSON encode karke API response dena
  2. (Real-Life) JSON file se user profile data read
  3. (Real-Life) Settings ko JSON config file mein store
  4. (Real-Life) AJAX request ko JSON response dena
  5. (Real-Life) Third-party API ka JSON read karna
  6. (Abstract) json_encode(["a"=>1,"b"=>2])
  7. (Abstract) json_decode('{"x":10,"y":20}',true)
  8. (Abstract) json_last_error() check karna
  9. (Abstract) JSON ko associative array banane ke liye 2nd param true
  10. (Abstract) Pretty print JSON JSON_PRETTY_PRINT

15. Date aur Time

Tashreeh:
date() aur DateTime classes time handle karte hain. Format, timezone change, calculations sab mumkin.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) Aaj ki tareekh home page par
  2. (Real-Life) Delivery date estimate dikhana
  3. (Real-Life) Events ke timestamps log karna
  4. (Real-Life) Promotions ki scheduling
  5. (Real-Life) UTC time ko local timezone mein convert karna
  6. (Abstract) date("Y-m-d") current date
  7. (Abstract) date("H:i:s") current time
  8. (Abstract) DateTime object use karna
  9. (Abstract) Formats change karna date("F j, Y")
  10. (Abstract) time() current timestamp

16. Error aur Exception Handling

Tashreeh:
try/catch blocks exceptions handle karte hain. error_reporting() error levels set karta hai.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) DB connection error try/catch
  2. (Real-Life) File not found pe friendly error message
  3. (Real-Life) Invalid user input par exception throw
  4. (Real-Life) Exceptions log file mein
  5. (Real-Life) User ko friendly error page dikhana
  6. (Abstract) try{...}catch(Exception$e){...}
  7. (Abstract) throw new Exception("Error")
  8. (Abstract) error_reporting(E_ALL); sab errors
  9. (Abstract) set_error_handler() custom handler
  10. (Abstract) finally block cleanup ke liye

17. Object-Oriented Programming (OOP)

Tashreeh:
OOP classes, objects, properties, methods, inheritance, interfaces use karta hai. Yeh code ko structured banata hai.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) class Product {public $name;...} product ko represent karna
  2. (Real-Life) class User {private $email;...} user data encapsulate karna
  3. (Real-Life) class ShoppingCart addItem(), getTotal() methods
  4. (Real-Life) class Order placeOrder() method
  5. (Real-Life) class PaymentGateway interface implement karna
  6. (Abstract) class MyClass{} aur new MyClass()
  7. (Abstract) Inheritance: class Child extends Parent
  8. (Abstract) interface MyInterface{} implement karna
  9. (Abstract) __construct() initialization
  10. (Abstract) static properties/methods

18. Namespaces aur Autoloading

Tashreeh:
Namespaces classes ko organize karte hain. Autoloading se require bar bar nahi karna parta.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) namespace App\Controllers; class HomeController{}
  2. (Real-Life) App\Models, App\Views mein classes organize karna
  3. (Real-Life) Composer autoload se libraries load
  4. (Real-Life) Large projects mein naming conflicts se bachna
  5. (Real-Life) Third-party packages ko asani se integrate karna
  6. (Abstract) require "vendor/autoload.php";
  7. (Abstract) use App\Models\User;
  8. (Abstract) PSR-4 structure follow karna
  9. (Abstract) composer dump-autoload run karna
  10. (Abstract) namespace MyProject; file ke start mein

19. Security Best Practices

Tashreeh:
XSS se bachne ke liye output escape karein, SQL injection se bachne ke liye prepared statements, CSRF tokens use karein, passwords hash karein.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) htmlspecialchars() user comments output pe
  2. (Real-Life) password_hash() user passwords ke liye
  3. (Real-Life) Prepared statements DB queries mein
  4. (Real-Life) CSRF token hidden field mein
  5. (Real-Life) Output escaping in HTML templates
  6. (Abstract) filter_var() input validation
  7. (Abstract) Length checks on input fields
  8. (Abstract) HTTPS use karna
  9. (Abstract) Secure cookie flags set karna
  10. (Abstract) File permissions sahi rakhna

20. Database Connection (MySQL, PDO)

Tashreeh:
PDO se MySQL connect karo, queries run karo, results fetch karo.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) Products table se data fetch
  2. (Real-Life) Users table mein new user insert
  3. (Real-Life) Product price update query
  4. (Real-Life) User account delete query
  5. (Real-Life) User ke orders fetch karna
  6. (Abstract) $pdo=new PDO("mysql:host=localhost;dbname=test","user","pass");
  7. (Abstract) $stmt=$pdo->query("SELECT * FROM table");
  8. (Abstract) $row=$stmt->fetch(PDO::FETCH_ASSOC);
  9. (Abstract) $stmt->execute() prepared statements ke sath
  10. (Abstract) try/catch for connection errors

21. Prepared Statements

Tashreeh:
Prepared statements SQL injection se bachate hain. Data aur query ko separate rakhte hain.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) SELECT * FROM users WHERE email=?
  2. (Real-Life) INSERT INTO products(name,price)VALUES(?,?)
  3. (Real-Life) UPDATE inventory SET qty=? WHERE id=?
  4. (Real-Life) Keyword search with LIKE ?
  5. (Real-Life) ID se record delete
  6. (Abstract) $stmt=$pdo->prepare("...")
  7. (Abstract) $stmt->bindParam(...)
  8. (Abstract) $stmt->bindValue(...)
  9. (Abstract) $results=$stmt->fetchAll()
  10. (Abstract) $stmt->rowCount()

22. Composer ka Istemaal

Tashreeh:
Composer dependency manager hai. composer.json mein libraries define karein, composer require se install.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) composer require stripe/stripe-php payment library
  2. (Real-Life) PHPMailer install aur use karna
  3. (Real-Life) Router package for pretty URLs
  4. (Real-Life) composer update dependencies update karna
  5. (Real-Life) Apne code ko PSR-4 se autoload karna
  6. (Abstract) composer init
  7. (Abstract) composer install
  8. (Abstract) require "vendor/autoload.php"; code mein
  9. (Abstract) version constraints in composer.json
  10. (Abstract) composer dump-autoload

23. PHP Frameworks ka Intro (Laravel example)

Tashreeh:
Laravel jaise frameworks MVC structure, routing, ORM dete hain, jisse development tez aur organized ho jati hai.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) Route::get('/products',...) routing
  2. (Real-Life) php artisan make:controller ProductController
  3. (Real-Life) Eloquent se Product::all()
  4. (Real-Life) Blade templates mein product listing
  5. (Real-Life) Migrations se database tables banana
  6. (Abstract) php artisan serve local server
  7. (Abstract) .env file mein DB credentials
  8. (Abstract) Middleware for auth checks
  9. (Abstract) Dependency injection in controllers
  10. (Abstract) php artisan test unit testing

24. APIs Banana aur Consume karna

Tashreeh:
RESTful APIs JSON data return karti hain. cURL ya Guzzle se external APIs consume kiye ja sakte hain.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) JSON response frontend ke liye
  2. (Real-Life) Token based API authentication
  3. (Real-Life) POST request se new resource create karna
  4. (Real-Life) cURL se weather API data laana
  5. (Real-Life) Rate limiting API calls
  6. (Abstract) header('Content-Type: application/json');
  7. (Abstract) echo json_encode($responseArray);
  8. (Abstract) file_get_contents("http://api.example.com")
  9. (Abstract) curl_init(), curl_setopt(), curl_exec()
  10. (Abstract) json_decode() API response parse karna

25. Advanced Topics (Design Patterns, Caching, Performance)

Tashreeh:
Design patterns se code maintainable banta hai. Caching (APCu, Redis) se performance behter. Profiling aur optimization zaroori hai.

Misalay (10 total: 5 real-life, 5 abstract)

  1. (Real-Life) Singleton pattern DB connection ke liye
  2. (Real-Life) Strategy pattern alag payment methods handle karne ke liye
  3. (Real-Life) Redis caching frequently accessed products
  4. (Real-Life) Queue system (RabbitMQ) orders process karne ke liye
  5. (Real-Life) Load testing aur performance improve karna
  6. (Abstract) Factory pattern objects banane ke liye
  7. (Abstract) apcu_store() aur apcu_fetch() cache ke liye
  8. (Abstract) Code profiling tools jaise xhprof
  9. (Abstract) OPcache se PHP scripts cache karna
  10. (Abstract) SOLID principles follow karna

Aakhri Mashwaray aur Resources

  • Practice:
    Khud se choti moti projects banaen, code ko modify karein aur problems solve karein.
  • Documentation aur Kitabain:
  • Online Tutorials/Courses:
    • W3Schools, Codecademy
    • Laracasts (Laravel ke liye)
  • Up-to-date Rehna:
    Nai PHP versions aur best practices se waqif rahein.
  • Is Roman Urdu guide ko follow karke aap PHP ki dunya mein basic se lekar advanced level tak pehunch sakte hain. Consistent practice aur real-life projects par kaam karne se aapko behtareen maharat hasil hogi.
Learn PHP in Roman URdu, Learn PHP, Roman Urdu Programming, Shahid Malla PHP Developer
16 min read
Dec 10, 2024
By Shahid Malla
Share

Leave a comment

Your email address will not be published. Required fields are marked *