Jump to content

bentonsmith

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

bentonsmith's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have played with trhe code now - preg_replace - works. The reason I could not use the [img] as a trigger is that some users do not use the [img] tag to post a picture. Just in case others have a similar problem - this is how i sorted it out [code]preg_match_all("/http:\/\/?[^ ][^<]+/i",$post_text,$matches); // Count how many eliments in the $matches array $nor = count($matches);[/code] After I count the number of matches in the array - I tiedied it up and whalla! Thanks for your suggestions though Benton
  2. Hi All, I am currently battling to sort out a string manipulation problem. Being new to PHP I'm sure the solution is not that difficult. Perhaps someone here can point me in the right direction. Here is the problem. I have the following string [code]This is a test string for Benton's script here is [img:445865]http://www.asite.com/testing/one.jpg[/img:445865] furthermore to this test is the following too http://www.another.com/two.gif I need to strip this off to[/code] I need to turn the string above into this [code]http://www.asite.com/testing/one.jpg http://www.another.com/two.gif [/code] Basically stripping everything out except the two URL's! Any help would be greatly appreciated. Benton
×
×
  • 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.