This is really bizarre because I checked that the two strings which I have concatenate does not have a space between them in the HTML source code. However, when PHP parse the text in my update.php file, it returns string1 string2 instead of string1string2 which is the expected output.
What went wrong?
Update.php
<?php
$string1 = $_POST['string1'];
$string2 = $_POST['string2'];
$filename = str_replace(" ", "", substr($string1, 14))
. str_replace(" ", "", substr($string2, 11));
echo $filename;
?>
$_POST['string1'] = Exchange Name: Osaka;
$_POST['string2'] = Stock Name: 20;
str_replaceinstead of just space, e.g.str_replace(array(' ', '\n', '\t'), '', $subject);