php - str_replace is not working properly -
hi im gonna trying add x,y location static google maps image location string is
$googlemapstatic="http://maps.googleapis.com/maps/api/staticmap?center=(location)&zoom=7&size=1000x1000&markers=color%3ablue|label%3as|11211&sensor=false&markers=size:mid|color:0x000000|label:1|(location)";
and have x , y latitude , longitude
$koorx='32.323213123'; $koory='39.3213';
and im using str replace changing static maps location , marker inside it.
$newlocation=$koorx.','.$koory; $googlemapstatic=str_replace('location',$newlocation,$googlemapstatic);
but shows me different location input.
<img style='width:15.61cm; height:12.0cm' src=".$googlemapstatic.'>
if write x,y manually browser, show correct location. assume there mistake in str_replace function couldn't find it.
use
ini_set('display_errors','on'); error_reporting(e_all);
if deprecated kind of error try use str_ireplace
$newlocation=$koorx.','.$koory; $googlemapstatic=str_ireplace('location',$newlocation,$googlemapstatic);
Comments
Post a Comment