PHP string concatenation
Just use .
for concatenating.
And you missed out the $personCount
increment!
while ($personCount < 10) {
$result .= $personCount . ' people';
$personCount++;
}
echo $result;
Concatenating strings having dot(period) in php
If the variables contains eg. space, they has to be in quotes. Concat operators cause no problem.
echo "<input type='text' value='" . $value . "' name='" . $input_id . "'/>";
PHP left string concatenation operator?
The closest thing to a built-in function would be using strpad like
$a = str_pad($a, strlen($a)+strlen("b"), "b", STR_PAD_LEFT);
but as others have pointed out its much simpler to just do $a = "b" . $a;
PHP syntax error for concatenation of string with the . operator
try this query:
$sqlCheckUser = "SELECT * FROM `user` where `email` = '".$email ."' OR `username` = '".$username ."'";
Related Topics
Fatal Error: Call to Undefined Function MySQL_Connect()
Preserving Session Variables Across Different Domains
Strict Standards: MySQLi_Next_Result() Error With MySQLi_Multi_Query
Insert Blobs in MySQL Databases With PHP
PHP Regex to Match Outside of HTML Tags
Convert Backslash-Delimited String into an Associative Array
How Do PHP Sessions Work? (Not "How Are They Used")
How to Test a Url For 404 in PHP
Remove Excess Whitespace from Within a String
How to Get the Base Url With PHP
Submitting a Multidimensional Array Via Post With PHP
PHP: Custom Error Handler - Handling Parse & Fatal Errors
PHP.Ini & Smtp= - How to Pass Username & Password
How to Fix the Session_Register() Deprecated Issue
Url Rewriting: Css, Js, and Images Not Loading