$row_getCalEve = str_replace(‘SEE GOOGLE CALENDAR AT BOTTOM OF PAGE’, ‘<a href=“#calendar”>SEE GOOGLE CALENDAR AT BOTTOM OF PAGE</a>’, $row_getCalEve);
Does anyone see anything wrong with this? I’m trying to get ‘SEE GOOGLE CALENDAR AT BOTTOM OF PAGE’ to turn into a link within a page and it doesn’t seem to be working.
Thanks, pmw57. I guess I need to look into this a little further. I’ve never really had a problem using this str_replace, but it doesn’t seem to be working as I thought it would.
The initial value is FIRE ACADEMY CALENDAR (SEE GOOGLE CALENDAR AT BOTTOM OF PAGE). I thought by putting in a shortened first value, it would be able to search it simply and replace it with the second value.
I’m using this and it seems to work just fine:
$row_getCalEve = str_replace(‘Calendar’, ‘<a href=“http://this_website”>Calendar</a>’, $row_getCalEve);
Would you find it even stranger if I say that it works for me.
<?php
$row_getCalEve = 'FIRE ACADEMY CALENDAR (SEE GOOGLE CALENDAR AT BOTTOM OF PAGE).';
$row_getCalEve = str_replace('SEE GOOGLE CALENDAR AT BOTTOM OF PAGE', '<a href="#calendar">SEE GOOGLE CALENDAR AT BOTTOM OF PAGE</a>', $row_getCalEve);
echo $row_getCalEve;
?>
Output:
FIRE ACADEMY CALENDAR ([SEE GOOGLE CALENDAR AT BOTTOM OF PAGE](#calendar)).
This implies that there is something unaccounted for with your initial $row_getCalEve value.
I’ve tried your instance with modification:
$row_getCalEve =‘GOOGLE CALENDAR’;
$row_getCalEve = str_replace(‘GOOGLE CALENDAR’, ‘<a href=“#calendar”>GOOGLE CALENDAR</a>’, $row_getCalEve);
and what I got was this:
<: <
<
Time: <
Download: <
This is the first record displaying. The other eight display fine–the eighth being the text that includes the ‘Google Calendar’ content, but even that isn’t turned into a link.