• Can it be done? Can you change a word that is in a HTML code (the page has .php on the end). For example with PHP you can make a language document where if you put hello world the language file will change it to world hello or add code around it. Can this be done with words in a html document with the .php extention?
    Regards
    Marzar

Viewing 13 replies - 1 through 13 (of 13 total)
  • From what I grasp of your post, YES IT CAN!
    https://us3.php.net/str_replace
    However there is no *direct* way to do this. If you’re using WP and want to change words in your posts that would be childsplay. If you’re talking about a regular HTML file, we might have to play some tricks such as buffers or heredoc statements.
    A few more details would help solve this problem

    Thread Starter marzar00

    (@marzar00)

    Thats sort of what I had in mind. For example:
    Page name: something.php
    where I have the word WordPress it changes it so that the acronym code is put around it.
    That the best way to say it really I think
    Regards
    Marzar

    Where is the word coming from? Is it just typed into something.php or is it coming from an external source like a database?

    Thread Starter marzar00

    (@marzar00)

    just typed in. Just like you make a html document and write WP in it and save it as a php document

    Thread Starter marzar00

    (@marzar00)

    whats the EOD for and do i close the tag before i out the html in?
    Regards
    Marzar

    Thread Starter marzar00

    (@marzar00)

    Ok I will try it and see if it works. Before I forget thankyou sooooooo much your a life saver (and time saver).
    Best Regards
    Marzar

    Thread Starter marzar00

    (@marzar00)

    I just added it and i can’t see my page in the design view in dreamweaver? I don’t think that the <<<EOD worked!
    Regards
    Marzar

    WP has addons that let u do this. I use phpGiggle. There are more!

    Thread Starter marzar00

    (@marzar00)

    does this work on a page with out having wp on that page?
    Regards
    Marzar

    u need to send content to a function. so if u can manage to do that… it should work…

    Thread Starter marzar00

    (@marzar00)

    what fo you mean by that?
    Regards
    Marzar

    let some php guy explain this better.
    the simple funda is… wp sends the content of a post through a variable. you send that variable to a function which does all the text changes. if you can make ur nonwp page to send the content of the page to that function you are good to go.

    Thread Starter marzar00

    (@marzar00)

    ok do you know someone who might know how to do that?
    Marzar

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Change words in HTML using PHP’ is closed to new replies.