Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2013
    Thanked 0 Times in 0 Posts

    How to remove part of a title name using php conversion tool?

    I am still a novice with PHP but I feel like I am making this task more complicated then it needs to be.

    I recently acquired a tool (dumpHTML) that is coded in php which allows me to convert mediawiki content into html. I have been trying to make minor changes to it so it looks more clean after i convert to html. All the titles of my pages end with " - Docwiki" (Example: "Hole Mounts - Docwiki") and i do not like that. I want to write something that deletes the " - Docwiki" at the end of every title once i use the conversion tool.

    Here is the original code line:

    PHP Code:
    <title><?php $this->text('pagetitle'?></title>

    Here is what I have attempted and i get a fatal error when i try to run the tool:

    PHP Code:
    chop($pagetitleA" - Docwiki");
    <title><?php $this->$pagetitleA ?></title>
    I also had a suggestion to try this and it didn't work:

    PHP Code:
    <title><?php echo str_replace("- Docwiki",'',$this->text('pagetitle')); ?></title>
    Is there something I am missing or doing completely wrong? Any help or suggestions will be greatly appreciated!

  2. #2
    Regular Coder Arcticwarrio's Avatar
    Join Date
    May 2012
    Thanked 100 Times in 100 Posts
    looks like you editing part of a function or class,

    can you paste all of it?
    There are 10 types of people on CodingForums,
    Those who understand Binary and those who dont.
    Get Cloud Hosting now from only£59 / month


Posting Permissions

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