Ok so my website is Kywordpro.com
I want the search query to auto capitalize the first letter to make it look more professional in other search engines an on the site.
Can anyone help with this?
Tim..
Ok so my website is Kywordpro.com
I want the search query to auto capitalize the first letter to make it look more professional in other search engines an on the site.
Can anyone help with this?
Tim..
Ok Snookerman you were helpful but I still am confused.
I am not sure where to put the code since I didnt write the code for my site.
Tim..
Ok if you visit my site you will see that whatever you search appears in the TITLE liek this.
search words :: KyWordPRO.com
I want it to look like this.
Search Words :: KywordPRO.com
Does that make more sence?
To make this happen the code in place is
<title><?php echo isset($q) ? ('' . $q) : TITLE; ?> :: KyWordPRO.com</title>
Change it to this:
<title><?php echo isset($q) ? ('' . ucwords($q)) : TITLE; ?> :: KywordPRO.com</title>
Ok so if I wanted to emplement this version
<?php
function title_case($title) {
$smallwordsarray = array(
'of','a','the','and','an','or','nor','but','is','if','then',
'else','when',
'at','from','by','on','off','for','in','out',
'over','to','into','with'
);
$words = explode(' ', $title);
foreach ($words as $key => $word)
{
if ($key == 0 or !in_array($word, $smallwordsarray))
$words[$key] = $this->my_ucwords(strtolower($word));
}
$newtitle = implode(' ', $words);
return $newtitle;
}
?>
How would I make it possible?
Last edited by tgallagher26; 02-23-2009 at 08:58 PM.
What do you want to be capitalized? $newtitle?
To:PHP Code:return $newtitle;
PHP Code:return ucfirst($newtitle);
Jeremy | jfein.net
tgallagher26 (03-06-2009)
Bookmarks