Jump to content

SEO Keyword Hyperlinker Script: Technical Error


djstaz0ne

Recommended Posts

Hi,

 

I am working on a SEO Keyword linking script and i need help fixing a bug in my regex pattern.

 

$keywordz = array("api integration salesforce integration","salesforce integration","api integration","web services");

 

Here is my pattern ($url can be any url):

for($i=0;$i<count($keywordz);$i++){

$pattern = '!(<[^a][^>]*>[^<]*)('.$keywordz[$i].')!i';

$replacement = '$1<a href="/'.$url.'">$2</a>';

$text = preg_replace($pattern, $replacement, $text);

}

 

Here is the text the pattern is having problems with:

<h1>Salesforce Integration and API Integration in New York</h1>

<p>Perpetual Technologies Unltd. specializes in api integration and Salesforce Integration in New York City. We have extensive experience in integrating CRM Systems with additional corporate data, utilizing web services APIs - working with SOAP and PHP. We can connect your "online work requests" to salesforce, automatically storing them in a database, and automatically generating and emailing "job tickets", listing all relevant project-related information. Salesforce Integration will help your company operate more smoothly.</p>

 

URL: http://perpetualtechnologies.net/salesforce-integration/api-integration.htm

 

The Problem:

The first occurrence of "Salesforce Integration" does not get hyperlinked..  :confused:

 

Can anyone help me out??

 

Thanks in advance,

 

Nik

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.