MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology

PHP Programing language

Strings in PHP
Previous Home Next

Strings

A string is a combination of letters, numbers, special characters and arithmetic values or individuals. First of all, we have to create string like a variable. There are two procedure to use string in php:

  1. You can store string in a function.
  2. You can store string in a variable.

Example: (Sample example)

<html>
<head>
<title>strings in PHP</title>
</head>
<body>

<?php
$myString = "This is a string...";
echo "Hello World....!!!!<br/>";
echo $myString; 
?>
</body>
</html>

 

Output:

Strings with Single Quotes & Double Quotes

Single Quotes: This is the simplest way to create strings. It works on server easier and faster. There is no need to read whole string.

Example:

<html>
<head>
<title>single quotes in PHP</title>
</head>
<body>

<?php
 $myString = 'Hello World....!!!!';
 echo 'This is a string<br/>' . $myString ;
?>
</body>
</html>

Output:

Double Quotes: In Double Quotes, You can insert variables directly within the text of the string. The variables were automatically detected and concatenated with the text.

Example:

<html>
<head>
<title>double quotes in PHP</title>
</head>
<body>

<?php
 $myString = "Hello World....!!!!";
 $symbol = "@";
 echo "$myString<br/>";
 echo "This is Arun Kumar $symbol abc PVT. Ltd.";
?>
</body>
</html>

Output:

Previous Home Next