Jump to content

TheFunkeyGibbon

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

TheFunkeyGibbon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a set of infomation in the following format. This is an example - the data might not always be in this exact orfder and there may be more or less infro in this memo field. pMADate={25/04/2005} pSBDate={25/04/2005} pexchfcst={31/05/2005} bPhone='m: 555 55555;' bsAttn=1 pCompDate={28/10/2005} What I need to do is be able to pull that info into a var (say $blah) and then trim the info either side of a partiular pattern such as 'pSBDate={%/%/%}' so that all that I end up with a var with only that bit of data in it. I'm not sure if this is totally clear but if you think you can help please let me know and I'll try and clarify any points that are not well explained. Thanks for any and all help!
  2. [!--quoteo(post=354957:date=Mar 14 2006, 05:35 PM:name=fusionpixel)--][div class=\'quotetop\']QUOTE(fusionpixel @ Mar 14 2006, 05:35 PM) [snapback]354957[/snapback][/div][div class=\'quotemain\'][!--quotec--] One solution might be using a regular expression that pulls out the date. check out this tutorial: [a href=\"http://weblogtoolscollection.com/regex/regex.php\" target=\"_blank\"]http://weblogtoolscollection.com/regex/regex.php[/a] Now... there might be more ways to do it, but that could be one. good luck [/quote] Thanks. I thought I'd let you know I'd found this: [code]function remover($string, $sep1, $sep2) {        $string = substr($string, 0, strpos($string,$sep2));        $string = substr(strstr($string, $sep1), 1);        return $string; } $string = "Some text (some note) some other text"; $str1 = "("; $str2 = ")"; echo remover($string, $str1, $str2); [/code] That is a pretty good way of getting what I want.
  3. Firstly thanks for any help offered! Now down to business. I am trying to select a date from a memo field where it is preceded by some identifying text e.g. [i]RegDate={01/01/2005}[/i] However there is a lot of other data in the memo too. It's been used as a sort of custom field for the user to add custom database fields (don't ask... :roll: ). What I need to do is get out the date part of that italic text above and convert it into a date that I can use to calculate the date between that date and another one (one that is sensibly stored as a date in the db). The database (MySQL) isn't mine. So I can't change anything to do with it. Please ask if this doesn't make sense, it really is at the limits of my MySQL and PHP understanding.
×
×
  • 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.