2082 4

BIT301 ยท 2082 ยท 5 marks

Write a program that will read your name as input string. Access and display the individual characters in the name string.

Write a program that will read your name as input string. Access and display the individual characters in the name string. [5]

Web Technology IIChapter 5: String Processing and Regular ExpressionsCharacter access in strings

A PHP string is an indexed sequence of characters, and a single character is reached with square brackets exactly as an array element is, so $name[0] is the first character. strlen() returns the length, therefore a counting loop running from 0 up to strlen($name) - 1 visits every position in turn...