22, November 2008

trouble with this pattern - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: trouble with this pattern
« previous next »
Pages: [1] Print

Author Topic: trouble with this pattern  (Read 602 times)
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6440
39464 credits
Members referred : 374


It's time to use PHP5!


« on: May 06, 2007, 08:09:07 PM »

Hi,

I don't know whats wrong here, maybe you see whats the problem with this pattern:

Code:
<?php

preg_replace
('/h\ref="h\t\tp:\/\//''href="go.php?to=''<a href="http://www.domain.com">anchor</a>');

// result must be somthing like: <a href="go.php?to=www.domain.com">anchor</a>


Last blog : Just a better Internet portal provided by Google
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #1 on: May 06, 2007, 08:19:09 PM »

shouldn't it be:
Code:
<?php

preg_replace
('/href="http:\/\//''href="go.php?to=''<a href="http://www.domain.com">anchor</a>');


Last blog : Are You Stumbling Yet?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6440
39464 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: May 06, 2007, 08:26:27 PM »

shouldn't it be:
Code:
<?php

preg_replace
('/href="http:\/\//''href="go.php?to=''<a href="http://www.domain.com">anchor</a>');

this is what I tried first, the t and the r have also a function that why I escaped them


Last blog : Just a better Internet portal provided by Google
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #3 on: May 06, 2007, 08:32:46 PM »

Seems to work like that on my server...


Last blog : Are You Stumbling Yet?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6440
39464 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: May 06, 2007, 08:44:37 PM »

strange I removed the extra backslashes and its working now Huh


Last blog : Just a better Internet portal provided by Google
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6523
Tags : regex preg_match Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: trouble with this pattern
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Nov 22, 2008, 03:15:32 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 37.736
Total Topics: 7.650
Total Members: 4.397
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: Janai

41 Guests, 3 Users online :

11 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.