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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:24:58+00:00 2026-05-28T02:24:58+00:00

I use codeigniter and want check if exists a url in content other url,

  • 0

I use codeigniter and want check if exists a url in content other url, return is true else it is false.

for example i want chack for url http://chat.stackoverflow.com/ that did there is in page http://stackoverflow.com/ or no.

I tried as, it have error:

<?php
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,'http://stackoverflow.com/');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $contents = curl_exec($ch);
    curl_close($ch);
    $link="http://chat.stackoverflow.com/"; 
    if(preg_match($link,$contents) && stripos($contents,"chat.stackoverflow")){
      echo "yes";
    }else{
    echo "no";
    }
?>

Output is as:

Warning: preg_match(): Delimiter must not be alphanumeric or backslash in /code/O4savv on line 8
no

Demo: http://codepad.viper-7.com/O4savv

How is fix 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-05-28T02:24:58+00:00Added an answer on May 28, 2026 at 2:24 am

    You need to add a leading and ending forward slash to the pattern for the regular expression. And also, escape the forward slash that is part of the pattern you’re trying to match to avoid conflict.

    $link="/http:\/\/chat.stackoverflow.com/"; 
    

    http://codepad.viper-7.com/PWMVzl

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm running a LAMP environment with CodeIgniter. I want to be able to use
I use codeigniter.I want search in site contents for several word, that did existence
I use CodeIgniter 2.1.0, i want after insert data in database get a message
I use CodeIgniter 2.1.0, i store data session in database ci_sessions , i want
I am building a Facebook app using iframe rendering. I want to use CodeIgniter
i use of codeigniter and rownum query, i want put WHERE in inside query
I have a website built in codeigniter, and now I want to use google
I use codeigniter and i want make uniqid code with php as following code(by
I want to use codeigniter for an ecommerce project I'm working on but I
I use codeigniter. I want multiple upload image, for this work, i use library

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.