Assalam o aliekum dosto... ye PHP or MySQLi ki 3rd class hy or es lecture may hum programming languages k ek bht important code ki baat karein gay or wo hy Comments.
Comments wo human read able line hoti hy jo hum apny liye ya ksi or code parhny walay k lye likhty hain.. jesay misal k tor per hum koi function likh rahy hain to hum us say pehly ye likhna chahty hon k ye function kia karta hy.. to hum comment de den gay... es video may sab details say btaya geya hy..
ziada tar programming languages may comments ko 2 tarah say likha jaa sakta hy... single line comment yani k ek he line ka comment ya multi line comment jo ek say ziada lines may chalta hy...
comments likhny ka taria---Single Line:
single line comment likhny k lye hum double forward slash lgaty hain or usky bad apna comment likh dete hain.. misal k tor par:
// this is a comment blah blah blah
single line comments ko ziada tar ksi code ki line ya function kia karta hy wo btany k lye use kia jata hy.. yahn may ye btata chalu k jb PHP double forward slash dekhti hy to usky baad anay walay tmam characters ko ignore kar k directly next line may chali jati ho phr chahy wo koi php ka code ya function he kyu na ho. To aap esko code ki testing k lye bhi use kar sakty hain
Multi-line comment: Multi-line comment likhny k lye hum ek forward slash or ek asterisk lgaty hain jo humary comment k start ko btata hy..
/*
ab es asterisk yani k star k sign k bad jo bhi aye ga to PHP usay ignore karta chala jaye ga jb php ko ek or asterisk or forward slash ka combination nahi mil jata yani k
*/
to ek multi-line comment es trah likha jata hy
/*
this is
a multi line
comment
*/
multi line comment bht faiday ki cheese hain enko hum apna code test karty huye bhi check kar sakty hain yani code ki kuch lines comment kardi taa k ye pta kar sakein k error kahn say aa rha hy..
Bookmarks