Jump to content

Removing spaces within the title="" attribute ?


pixeldesigner

Recommended Posts

Using php, how can I replace spaces with hyphens (-) but only do this for the text within the title="" attribute of a specific set of links?

Example:

I have 2 sets of links and i want to replace the spaces within the title="" attribute but only on the links in the second div, not the first.

<div class="set1">
<a href="#" title="THIS IS THE TITLE">
<a href="#" title="THIS IS THE TITLE">
</div>


<div class="set2">
<a href="#" title="THIS IS THE TITLE">
<a href="#" title="THIS IS THE TITLE">
</div>

Is this possible?

 

would like it to look like this:

 

<div class="set2">
<a href="#" title="THIS-IS-THE-TITLE">
<a href="#" title="THIS-IS-THE-TITLE">
</div>

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.