Posts

What Is Kotlin - About Kotlin

Brief info about Kotlin Kotlin is a statically typed programming language for modern multiplatform applications.  Kotlin   runs on the Java virtual machine and also can be compiled to JavaScript source code or use the LLVM compiler infrastructure. Its primary development is from a team of JetBrains programmers based in Saint Petersburg, Russia. Kotlin for Android Kotlin is now an official language on Android. It's expressive, concise, and powerful. Best of all, it's interoperable with our existing Android languages and runtime. How to started with Kotlin on Android Kotlin originated at JetBrains, the company behind IntelliJ IDEA, in 2010, and has been open source since 2012. With big advantages of Kotlin over Java & Android development, it is becoming more popular for alternative of Java among Java & Android developers.  Official site of Kotlin to learn more. Kotlin also supports  higher-order functions, anonymous functions, lambdas, inline func

How To Use function In PHP

How to use PHP functions Syntax: function functionname([arguments]) { } Functions can be placed anywhere in a page and will be available even if called above the actual function being created. The exception to this rule is if the function is only defined as part of a conditional statement, and is not available to be called until that conditional statement has been evaluated. Function names follow the same rules as other labels in PHP. A valid function name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. Example: declare of function without arguments <?php function  greetMsg() {      echo   "Hello PHP!" ; } greetMsg();  // call the function ?> Note : Functions need not be defined before they are referenced,  except  when a function is conditionally defined as shown in the two examples below. Otherwise you will get:  Fatal error : Call to undefined function greetMsg() When a function is defined in

How to define constant in PHP

Constants are like other variables but once they are defined they cannot be changed or undefined. Things to remember about PHP constant:   Constants are like variables except that once they are defined they cannot be changed or undefined. Syntax: define(name, value[, $boolean]) name– $string value– $scalar $boolean– [optional] default: FALSE, case-sensitive Define a constant , a set value that is assigned globally, making it available to functions and classes without passing them directly as an argument.  Examples: <?php define( "HELLO" ,  "I Love PHP" ); echo  HELLO; // output I Love PHP define( "HELLO" ,  "I Love PHP" ); echo  hello;  // output I Love PHP ?> Note: PHP  Constants are automatically global and can be used across the entire script . The example below show, how we can used a constant inside a function, though it is defined outside the function: <?php define( "HELLO" ,  "I Love

Things to know about PHP variables

Here are some tips which helps to you, how to declare PHP variables and used them. In computer programming ,  variables  are used to store information to be referenced and used by programs. They also provide a means of labeling data with a descriptive name. Creating or Declaring Variables in PHP In PHP, a variable starts with the dollar( $ ) sign, which followed by the name of the variable: Example: <?php $txt =  "Hello world!" ; // output Hello world! (string) $x =  5 ;                // 5                    (integer) $y =  10.5 ;             // 10.5                 (float) ?> Rules to follow while declaring variables in PHP A variable starts with the $ sign, followed by the name of the variable A variable name must start with a letter or the underscore character A variable name cannot start with a number A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ ) Variable names are case-sensitive ($salary

Things to know about PHP

Here are quick note and little attention that you should know before writing project code in  PHP. Basic PHP sysntax: A PHP script starts with  <?php  and ends with  ?> : <?php // Your PHP code goes here ?> The default file extension for PHP files is ".php". Note:   All statements must end in a semicolon ( ; )! Otherwise, errors will be generated. If the error doesn't make sense, you probably are missing a semicolon somewhere! Comments in PHP A comment in PHP code is a line that is not read/executed as part of the program. Its only purpose is to be read by someone who is looking at the code. Example on PHP comments: < !DOCTYPE  html > < html > < body > <?php // This is a single-line comment # This is also a single-line comment /* This is a multiple-lines comment block that spans over multiple lines in your project */ // You can also use comments to leave out some parts of a code line $x = 1 5   /* + 15

What is PHP - a brief info about php

PHP is a server side scripting language. that is used to develop Static websites or Dynamic websites or Web applications. PHP stands for Hypertext Pre-processor, that earlier stood for Personal Home Pages. PHP is a widely-used open source general-purpose scripting language that is especially suited for web development that can be easily embedded with html. It is one of the most popular web development language. WordPress, Magento like many blogging & eCommerce platform were built in PHP. PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.  A simple example on php: < !DOCTYPE  html > < html > < body > <?php echo   "PHP Script is working!" ; ?> < /body > < /html > Save the file as "simple.php" and run on your localhost. Path  of your project should be: localhost//project_name/simple.php (if you are using wamp)