Jump to content

kayra

New Members
  • Posts

    3
  • Joined

  • Last visited

kayra's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Phil, thank you for your reply and help. Does the code you wrote searches after the last "/" (slash)? Because all the urls are different in each line in links.txt file, when i look at the code above i see it searches only one url: https://blabla.com/blablabla/blablablabla/%s Is it true? Best regards.
  2. Hi, thank you for your reply, i'm a newbee and just want to figure out the php code above.
  3. Hi, as a newbee i'm trying to figure this code out: $search = get_the_title(); $lines = file('links.txt'); // Store true when the text is found $found = false; foreach($lines as $line) { if(strpos($line, $search) !== false) { $found = true; echo $line,"<br/>"; } } // If the text was not found, show a message if(!$found) { echo 'not found'; links.txt file contains links like: <a href="https://blabla.com/blablabla/blablablabla/The word or file to search" target="_blank" rel="noopener noreferrer">The word or file to search</a> I just want to search the this part: ( ">The word or file to search</a> ) of the url then return it as an clickable url and also limit search results to 3. Could somebody help me which code and where to put in php code above? Thanks in advance.
×
×
  • 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.