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 7521721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:18:36+00:00 2026-05-30T02:18:36+00:00

I have some line of statements in my database.Whenever I create an article and

  • 0

I have some line of statements in my database.Whenever I create an article and add any line of these statements in this article manually then I have to find these lines and make them link.
problem is that I am using ckeditor for article posting and user can add style to text also. So I have to maintain style of matched line and also make that link.

statements (saved in a table):

1: this is first line
2: this is second line
3: this is third line

Article to be created :

this is my article , this is <span style="color:red">first</span> line. rest of article.

Now when user add this article then (1) line should be matched and in article it should be appear as :

<a href="dfa">this is <span style=".">first</span> line</a>

Hope I stated my problem clearly.

Thanks in advance.

  • 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-05-30T02:18:37+00:00Added an answer on May 30, 2026 at 2:18 am

    Pattern for this is :

    $pattern = "/(<?.*>)?this(<\/?.*>)? (<?.*>)?is(<\/?.*>)? (<?.*>)?first(<\/?.*>)? (<?.*>)?line(<\/?.*>)?;
    
    preg_match_all($pattern,$str,$matches);
    $replacement="<a href='#'>".$matches[0][0]."</a>";
    $str = preg_replace($pattern,$replacement,$str,-1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used this example to create a database that I copy over on
I have some command-line ruby scripts for things like pre-processing text files before uploading
I have some text where each line of text has some good words and
I have some pyunit unit tests for a simple command line programme I'm writing.
I would like to have some space between the same line.. I know there
Does anyone happen to have some sort of a nice command line script they
I have a form that has a series of check boxes and some line
I received some multi-line data via HTTP and have it in one string. I
Suppose I have a file containing some lines: line 1 ... line 2 ...
i have drawed some figure(circle, rectangle or just a line) and after that 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.