Jump to content

variable with commas


bravo14
 Share

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

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.