Using viewcode.php ... need to modify

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jmueller0823
Forum Commoner
Posts: 37
Joined: Tue Apr 20, 2004 9:06 pm

Using viewcode.php ... need to modify

Post by jmueller0823 »

We're using this script:
http://www.evilwalrus.com/viewcode.php?codeEx=262

A sample of our page output is here:
http://www.growthtrac.com/popular.php

The script derives the page descriptions from the page <title>.
So, a page description might look like this:
Articles for Christian Marriage, Growthtrac-A Surprising Key

Instead of this (preferred): A Surprising Key

QUESTION

How can I strip the repetitive <title> text from the page descriptions?
The text we want to eliminate is: Articles for Christian Marriage, Growthtrac-

Please be specific... I'm not an expert. Thanks.
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Code: Select all

$string = "Articles for Christian Marriage, Growthtrac-A Surprising Key";
str_replace("Articles for Christian Marriage, Growthtrac-", "", $string);
jmueller0823
Forum Commoner
Posts: 37
Joined: Tue Apr 20, 2004 9:06 pm

Post by jmueller0823 »

Cool.

Got it. Thanks.
Post Reply