Jump to content

Recommended Posts

Apologies, I'm a complete beginner, so don't even know what to search for, I'm sure this is really elementary level.

 

I've got html text on a second page which I want to "include" in the main php web page and do a "string replace" on at the same time.

 

I can do the "include" OK on its own, but can't get the "string replace" to work at the same time, it just returns the unaltered text.

 

I then want to do something quite a bit more complicated but need to get over this hurdle first. Many thanks for any help.

 

<?php
$sidebar = 'index_files/sidebar-content2.html';
echo str_replace("Auks", "Penguins", include $sidebar);
?>

Link to comment
https://forums.phpfreaks.com/topic/218098-beginner-str_replace-and-include/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.