Home>
I am studying PHP on the web. It is displayed but as expected
Is not displayed. What is wrong?
Expected display: hi! Tom from $lang
Actual display: hi! $Name from $lang
"Tom" is not in "$name".
What should I do?
I don't know how to do this.
I use winndows10, Notepad ++, Xammp.
Please.
// function
$lang = 'php';
function sayHi ($name) {
$lang = 'php';
echo 'hi! $name from $lang';
}
sayHi ('Tom');
// var_dump ($lang);
?>
-
Answer # 1
Related articles
- php does not work on the browser
- php - i want to display the date received from the form as the date
- i also want to display the key name from the php array
- php - i want to display array values on an html table in laravel
- php - i want to get the file size of a blob file stored in the database
- php - [wordpress] how to display a list of articles of another custom post type on a single page of custom post type
- html - display flex does not work
- the specification of css is not reflected in jsp
- php - a method to display an array in a table
- php - i want the link to open in chrome
- php - i want to display all database values in an associative array on the web
- php - to display the record of the search condition specified in where
- php - display of tag clouds corresponding to categories (excluding specific tags)
- regarding repeated display in php
- php - what is the significance of array_key_exists?
- php - i want to expand and display a nested array in view
- css - the text is not centered
- php - the display size of paging is strange
- doe on how to loop php up to the value of a variable
- php - png image is not displayed
Trends
With single quotes, the variable contents are not expanded.
Use double quotations.