Results 1 to 3 of 3

Thread: How to combine two values into one string?

  1. #1
    Banned
    Join Date
    Aug 2004
    Posts
    132

    How to combine two values into one string?

    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.

  2. #2
    Registered
    Join Date
    Sep 2004
    Posts
    51
    The period is the concatenation operator in PHP.

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

  3. #3
    Banned
    Join Date
    Aug 2004
    Posts
    132
    Works like a charm, thanks a ton!

Similar Threads

  1. URL's with spaces in variable values
    By chromate in forum Search Engine Optimization
    Replies: 8
    Last Post: 10-16-2003, 04:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •