Jump to content

variable with commas


bravo14

Recommended Posts

Hi

 

I am defining a variable that contains commas e.g. "Manchester, United Kingdom" in the following way

 

$location=$_POST['select'];

 

However when I echo the variable, it only shows "Manchester," and ignores anything after the comma, how can I correct this?

 

Probable really simple.

Link to comment
Share on other sites

Are you sure $_POST['select'] contains what you think it does?

 

The behaviour you're describing isn't possible on it's own.

 

<?php

$_POST['select'] = 'Manchester, United Kingdom';

$location = $_POST['select'];

echo $location;
// outputs Manchester, United Kingdom

?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.