Php Cheatsheet Loading... Basics Hello World echo function is used to display or print output <?php echo "Hello World!"; ?> Comments Commets are used to make the code more understandable for programmer, they are not executed by compiler or interpreter. One Liner This is a singleline comment // Twinkle Twinkle Little Star Another One Liner This is a single-line comment # Chocolate dedo mujhe yaar Multiline This is a multiline comment /* Code With Harry */ Vardump This function dumps information about one or more variables. <?php var_dump(var1, var2, ...); ?> Variables Variables are "containers" for storing information. Defining Variables <?php $Title = "PHP Cheat Sheet By CodeWithHarry"; ?> Datatypes Datatype is a type of data String A string is a sequence of characters, like "Hello world!". <?php $x = "Harry"; echo $x; ?> Integer An integer is a number without any decimal part. <?php $x = 1234; var_dump(...
Join our blog for information about latest technology and IT.