What is String? (php) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is String? (php)

What is String? What can it do? Does string mean the number of alphabets in a sentence? example $string = "hello world" so output is 10?

13th Jun 2018, 11:30 AM
Danish Lim
Danish Lim - avatar
6 Answers
13th Jun 2018, 1:06 PM
Muhd Khairul Amirin
Muhd Khairul Amirin - avatar
+ 3
String's a data type containing charsequences. It can store values as "abc" or "Hello World". It can contain also chars which are numbers, but, that's important, it contains them as Strings: "hello 10" $string = "hello world"; does not output anything, cause you didn't print it out: echo $string; //output: hello world
13th Jun 2018, 11:43 AM
Jonas Schröter
Jonas Schröter - avatar
+ 2
character you put inside "_" or '_' is called string. it can be any alphabet or number. for example : print ("hello world") output is hello world print ("10" + "4" ) output is 104
13th Jun 2018, 2:29 PM
Vishal
+ 1
\”
13th Jun 2018, 3:26 PM
THEROOKIEPOTATO
THEROOKIEPOTATO - avatar
+ 1
Colby Welliver what you wanna say
13th Jun 2018, 3:28 PM
Jonas Schröter
Jonas Schröter - avatar
0
i think i wrote wrong for echo i wrote $str instead of $string
13th Jun 2018, 5:16 PM
Danish Lim
Danish Lim - avatar