Darkmatter5 Posted February 12, 2009 Share Posted February 12, 2009 How can I do an echo that lets me do a calculation "mid echo"? Example: $x=4; echo "X=$x<br>X+1=$x++<br>X-1=$x--"; this literally echos X=4 X+1=4++ X-1=4-- I need it to echo X=4 X+1=5 X-1=3 Link to comment https://forums.phpfreaks.com/topic/144997-how-to-do-a-calculation-mid-echo/ Share on other sites More sharing options...
wildteen88 Posted February 12, 2009 Share Posted February 12, 2009 $x = 4; echo "X=$x<br>X+1=".($x++)."<br>X-1=".($x--); Link to comment https://forums.phpfreaks.com/topic/144997-how-to-do-a-calculation-mid-echo/#findComment-760826 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.