PDA

View Full Version : How to combine two values into one string?



lz83ny
04-13-2005, 11:42 AM
I'm a php newbie and I'm working on my php based site, but got stuck abit because I want to update the page title for each page using variables from a database. So I have 2 variables: $category and $title and want them to be part of the page title so that it would look like this:
MySite.com - $category - $title.

Can anybody help find the right code? Thanks in advance.

Boricua
04-13-2005, 12:30 PM
The period is the concatenation operator in PHP.

$complete_title = "My Site.com - " . $category . " - " . $title;

lz83ny
04-13-2005, 05:54 PM
Works like a charm, thanks a ton!