PHP Json

PHP JSON in Hindi – What Is JSON In Hindi – JSON Kiya Hai

PHP

PHP JSON in HindiWhat Is JSON In HindiJSON Kiya Hai:- Is Post Main Ham JOSN Ke Bare Main Janne Wale Hain Or Dekhne Wale Hain Ki Json PHP Mai Kaise Work Karti Hai |

Yadi Aapne  HTML Full Course  And CSS Full Course And Python Full Course And PHP Full Course Nhi Read Kiya Hai To Aap Vah Bhi Read Kar Sakte Hai |

PHP JSON in Hindi

JSON Ka Istemal Waise Jyadartar Programming Language Mai Hota Hain And JSON Ka Istemal Karne Se DATA Ko Store Mai Aasani Hoti Hain |

What Is Json in Hindi – Json Kiya Hai ?

JSON Stands For JavaScript Object Notation, And Iska Istemal Syntax Ko Storing Karne Ke Liye And Fir Us Data Ko Exchanging Karne Ke Liye Hota Hain Ye JSON Kahlata Hain |

JSON Format Text-based Format Mai Hota Hai. Iske Duvara Data Ko Server Par Easily Sent Kiya Ja Sakta Hai And Fir Us Bad Ham Data Format Ko Ham Kisi Bhi Programming Language Ke Duwara Used Kar Sakte Hain. Jaise Ki Is Post Main PHP Main JSON Ka Istemal Karne Wale Hain |

PHP JSON Functions in Hindi

PHP Ke Kuch Built-in Functions Hai Jo Json Ko Handle Karne Mai Help Karte Hain. Lekin Ham 2 Important Functions Ki Baat Karne Wale Hain Jo Niche Diye Gaye Hain |

  • json_encode()
  • json_decode()

PHP json_encode() Function in Hindi

json_encode() Functions Ia Istemal Json Format Ke Value Ko Encode Karne Ke Liye Hota Hai|

Example_1:

<?php
$name = array('Danish' => 18, 'Rahul' => 34 , 'Priyanka' => 27);
$var = json_encode($name);
echo $var;
?>

Output:

{"Danish":18,"Rahul":34,"Priyanka":27}

Example_2:

<?php
$name = array('Danish', 'Rahul' , 'Priyanka');
$var = json_encode($name);
echo $var;
?>

Output:

["Danish","Rahul","Priyanka"]

PHP json_decode() Function in Hindi

json_decode() Function Ka Istemal Kisi Json Object Ko Ek PHP Object Ya Fir Associative Array Ko Decode Karne Ke Liye Kiya Jata Hai|

Also Read:- PHP Date and Time

Example_1:

<?php
$json_obj = '{"Danish":18,"Rahul":34,"Priyanka":27}';

var_dump(json_decode($json_obj));
?>

Output:

object(stdClass)#1 (3) { ["Danish"]=> int(18) ["Rahul"]=> int(34) ["Priyanka"]=> int(27) }

PHP Accessing the Decoded Values

Example:

<?php
$json_obj = '{"Danish":18,"Rahul":34,"Priyanka":27}';

$obj = json_decode($json_obj);

echo $obj -> Danish;
echo $obj -> Rahul;
echo $obj -> Priyanka;
?>

Output:

<?php
$json_obj = '{"Danish":18,"Rahul":34,"Priyanka":27}';

$obj = json_decode($json_obj);

echo $obj -> Danish;
echo '<br>';
echo $obj -> Rahul;
echo '<br>';
echo $obj -> Priyanka;
?>

Output:

18
34
27

Also Read:- PHP Filters

Leave a Reply

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