To use the value stored in a variable, use it anywhere where a value is required, such as the argument to a function or in an expression. For example, if you wish to print the value to the browser, you can type print($s) to print the value of a variable named s. You can even set a variable with the value of another, such as $s = $t.
If a variable contains a string, you may refer to each character using square brackets. Each character is numbered starting with zero. To refer to the seventh character in the s variable, you would type $s. This notation works both ways, in fact. You can set a single character of a string with an expression like $s ="x". Only the first character of the value on the right-hand side will be used to replace the specified character. If the variable on the left-hand side is not a string, it will be unchanged. Listing demonstrates the use of square brackets to reference single characters.
Referencing a Single Character
PHP Related Interview Questions
|PHP Interview Questions||MySQL Interview Questions|
|PHP+MySQL Interview Questions||Drupal Interview Questions|
|MYSQL DBA Interview Questions||PHP5 Interview Questions|
|WordPress Interview Questions||Joomla Interview Questions|
|CakePHP Interview Questions||CodeIgniter Interview Questions|
|PHP7 Interview Questions|
An Introduction To Php
Variables, Operators, And Expressions
Classes And Objects
I/o And Disk Access
Time, Date, And Configuration Functions
Parsing And String Evaluation
Sorting Searching And Random Numbers
Integration With Html
Efficiency And Debugging
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.