Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a url with timestamp, whitespace between date and time breaks url

I'm working on the Head First PHP and MySql book, and I have this problem with a date/timestamp. I'm going to make an URL with a date as a GET parameter. But when the date is returned from the database (type of timestamp), there is a white space betwen the date and the time, so the URL breaks.

How can I format the date to get included in the URL (along with the rest of the parameters)?

like image 317
erikric Avatar asked Feb 09 '10 16:02

erikric


1 Answers

use urlencode :]

http://php.net/manual/en/function.urlencode.php

like image 130
Adam Kiss Avatar answered Sep 19 '22 04:09

Adam Kiss