Basics Of PHP
Introduction to PHP PHP (Hypertext Preprocessor) is a server-side scripting language designed for web development. PHP code is executed on the server, and the result is sent to the browser as plain HTML. PHP statements end with a semicolon ; . PHP is case-sensitive for variable names but not for keywords. Variables Variables declared with $ symbol -> $name = "Anil"; Types are determined automatically (loosely typed). Variable names must start with a letter or an underscore _. Data Types String → "Hello, World!" Integer → 25 Float → 10.5 Boolean → true or false Array → ["PHP", "MySQL", "JavaScript"] Object → Instance of a class NULL → Represents a variable with no value Strings Functions strlen($str) → Returns the length of a string. str_replace("find", "replace", $str) → Replaces text within a string. strtolower($str) → Converts to lowercase. strtoupper($str) → Converts to uppercase. substr($str, start,...
Comments
Post a Comment