PHP code returning 000

0 Robert Summers · May 30, 2015
<?php
$str1 = 'one';
$str2 = 'two';

echo 'My name is ' + $str1 + str_replace('one', 'three', $str1); //What word, replace what, var
echo 'Hello, my name is ' + $str1 + ' ' + $str2 + ' and I like Fourty-five!';
echo "<hr/>" + '<hr/>';
?>

So this is my PHP and everytime I run this in a browser I get 000, why is this

Thanks for the help in return.

Post a Reply

Replies

Oldest  Newest  Rating
+1 William Frost · May 31, 2015
Well, if u want to combine two string togheter, u use the "." operator and not "+".
I have replaced and now its works https://ideone.com/pzAuSt .
  • 1

PHP

107,287 followers
About

Server-side, HTML embedded scripting language used to create dynamic Web pages.

Links
Moderators