2 small php problems

Associate
Joined
19 Jun 2006
Posts
162
Location
Swansea, Wales
Evening all,

I think it's way past my bedtime because these aren't working for me and i can't see why...

1. $dateadded = date(Y-m-d);
echo "date added: ", $dateadded;

It just outputs "date added: 0"

2. $name = preg_replace('/\s\s+/', '', $fullName);
echo "pub: ", $fullName;

Output if the $name was John Smith is still John Smith i.e. it doesn't remove the space.

Help please! I want to go to bed this side of 1am!
 
Cheers for that.

I know it must be late... i want date() in a variable so i could pass it to mysql db. Then i realised mysql has one of those lovely date functions!
 
Back
Top Bottom