Portal Home > Knowledgebase > Articles Database > Adding text and integer to switch($cat)
Adding text and integer to switch($cat)
|Posted by bambinou, 07-25-2010, 01:32 PM|
I have this code here:
$cat = (int) $cat;
case 1: $title = 'this is the page title 1';
case 2: $title = 'this is the page title 2';
At the moment this code check for numbers in my url and then change the title tag to the given $title above.
If let's says my site has a page called:
then the $title will add the required title tag.
I now have a problem, some of my pages do not always end with a number but a word, for a example:
I would like to associate an $title to each URL finishing with a word.
For example, if I have a url like the one above i would like to add this in the $cat = (int) $cat;
case download.html: $title = 'this is the page title 2';
How to do this please?
Add to Favourites Print this Article