4 Replies - 1780 Views - Last Post: 24 February 2011 - 04:36 AM Rate Topic: -----

#1 royjm248  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 51
  • Joined: 18-January 08

PHP string cleaning

Posted 21 February 2011 - 02:39 PM

Hello all readers.
Does anyone know of a good tutorial that really explains how to use preg_replace()?
I want to understand what is going on, and more to the point, I want to create the expressions rather than coping and pasting someones code. The PHP documentation is vague to me, and I have spent the last two days reading site after site that just gives you the code and says it will do 'what-ever-it-does'. I would like to know the code I am writing in the hope of writing code that will do what I want it to do.
Thanks in advance.

Is This A Good Question/Topic? 0
  • +

Replies To: PHP string cleaning

#2 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon



Reputation: 2870
  • View blog
  • Posts: 11,025
  • Joined: 15-July 08

Re: PHP string cleaning

Posted 21 February 2011 - 03:01 PM

Moved to PHP.
Was This Post Helpful? 0
  • +
  • -

#3 Valek  Icon User is offline

  • The Real Skynet
  • member icon

Reputation: 542
  • View blog
  • Posts: 1,713
  • Joined: 08-November 08

Re: PHP string cleaning

Posted 21 February 2011 - 03:40 PM

Then what you want isn't to learn how to use preg_replace(). What you want is to learn how to write Regular Expressions. This is what taught me, so I hope you're able to get the same benefit from it :)

MOD EDIT: Used bit.ly URL shortener on link so the "expressions" part of the URL doesn't get hosed by the board software.

This post has been edited by JackOfAllTrades: 24 February 2011 - 04:35 AM

Was This Post Helpful? 1
  • +
  • -

#4 CheckersW  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 12
  • View blog
  • Posts: 198
  • Joined: 04-April 09

Re: PHP string cleaning

Posted 23 February 2011 - 08:22 PM

I also find that it helps to write your own code rather than copying someone else's when you're learning.

Because of that I found the DreamInCode PHP Cheat Sheet really helpful (especially the string manipulation part). Hopefully that helps a bit.

This post has been edited by CheckersW: 23 February 2011 - 08:23 PM

Was This Post Helpful? -1
  • +
  • -

#5 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6058
  • View blog
  • Posts: 23,495
  • Joined: 23-August 08

Re: PHP string cleaning

Posted 24 February 2011 - 04:36 AM

Depending on what you're looking to do, the PHP Filter functions may be able to help as well.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1