php magic constants

__FILE__, __DIR__, __FUNCTION__, __CLASS__, __METHOD__, __TRAIT__ and __NAMESPACE__   PHP Magic Contants : Here are eight magical constants in PHP that change depending on where they are used.Some of these magical constants may provide useful information both within object-oriented programs as well as within procedural programs. The __FILE__ constant is the current filename, __LINE__ is the current line number, __FUNCTION__ is the current function name, __METHOD__ is the current method name (if any), and __CLASS__ is the current class name (if any). Starting with PHP 5.3.0, __DIR__ is the directory that__FILE__ is in and __NAMESPACE__ is the current name‐ space. … Continue reading php magic constants

constants in php

constants in php A constant in PHP is defined or declared by using define() function or by using the const keyword outside a class definition if you are using PHP 5.3.0. or a later version. If you define a constant one time, you can never change it or undefine it again. your constants can only contain boolean, integer, float and string (So called Scalar Data) . Global constants in PHP is assigned through the define() function Example ⇓ Global Constants <!DOCTYPE html>  <html>    <body>      <?php     define(“CONSTANT”, “Hello WebWideTutor!”);     echo CONSTANT;     ?>     </body>  </html> … Continue reading constants in php

Basics of HTML5

Elements in HTML5 HTML5 comes with  several elements which breaks a single document into multiple small contents that may be either related or independent. These elements add semantic richness to our markup, and make it easier to re-purpose our documents across media and devices.  

How to define HTML5 page structure The Doctyp First, we have the Document Type Declaration, or doctype. This tells our browser  or any other Parser what type of document it’s dealing with. It also detects the specific version of the HTML page.The doctype should be declared before any other writing of HTML in File. … Continue reading Basics of HTML5

php string slice truncate any character in word or in a text

You want to remove the first or last n characters from a string, use substr() The substr() function ist often when you need to slice off the required number of characters from the beginning or end of the string. The substr() function gives you the possibility to slice and dice strings into smaller strings. It accepts three arguments, of which the last is optional: the string to act on, the position to begin slicing at, and the number of characters to return from its start position. A negative value for the third argument tells PHP to remove characters from the end … Continue reading php string slice truncate any character in word or in a text

PHP Change String value behaviour or look

PHP How to Change Strings.Changing and Manipulate Strings in  PHP by using PHP Built-in Functions, strtoupper() ,strtolower()  ,strrev() ,ucfirst(), ucwords() and str_replace() You want to force a string to uppercase, meaning you want to capitalize a string. You can achieve that using the strtoupper() strtoupper function changes every letter of a string to capital letter. Usage: the function takes one string as a parameter input and returns a capitalized string. <?php $string = ‘arsenal is in good shape now’; echo strtoupper($string); ?> Output : ARSENAL IS IN GOOD SHAPE NOW You want to force a string to lowercase, meaning you … Continue reading PHP Change String value behaviour or look

php for web development

What is PHP ? According to the Site “PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. PHP is a server scripting language for creating dynamic Web pages. Taken directyle from the php Site “What distinguishes PHP from something like client-side JavaScript is that the code is executed on the server, generating HTML which is then sent to the client”. The client would receive the results of running that script, but would not know what the underlying code was. You can even configure your web server to process … Continue reading php for web development