I am trying to add a series of numbers to a string, but not add them up. The following code is adding the numbers up and giving me the result. I want it to simple add them to the string.
<?php foreach ($directions as $direct) {
    $latitude = $direct->start_location->lat; 
    $longitude = $direct->start_location->lng;  
    $dirco开发者_如何学Pythonrds += $latitude.','.$longitude.'|';
    }?><?php echo $dircords?>
Any ideas?
Marvellous
Use .= instead of +=.
. is the string concatenation operator. + is for additions.
See String operators.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论