Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7831095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:34:12+00:00 2026-06-02T11:34:12+00:00

I am using php4 and jquery, I have got a php string variable $content

  • 0

I am using php4 and jquery, I have got a php string variable $content which stores a string as shown below.

<html>
  <head></head>
    <table>
      <tr>
        <td>comments:</td>
        <td>Good</td>
         .....
         ...n rows
     </table>
  </html>

So, Now i want to change the color of all occurrences of text “Good” to red. So How to write a jquery function which takes a php string $content variable and changes the color of each “Good” word, (adds a style color:red) and returns it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T11:34:18+00:00Added an answer on June 2, 2026 at 11:34 am

    Pure PHP solution:

    echo str_replace('Good', '<span style="color:red">Good</span>', $content);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to solve rounding mechanism by using php4,5.2 and below (not 5.3)
I'm using a PHP4 implementation of SimpleXML, which uses the built-in xml_* functions from
I'm using PHP 4.3.9, Apache/2.0.52 I'm trying to get a login system working that
using the jquery ui modal dialog , the background shades grey (i assuming this
Using delphi 2010, i am wondering if there someway to escape the following string
I want to control the access in php website. I have a solution right
Can someone help me to setup php4 for using json? Thanks!
I am using PHP 4, that is what the host has at the moment.
I am trying to perform a simple jQuery AJAX attempt using either a .get()
To clarify: I'm not using the gettext php module /extension, reason being because I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.