Jump to content

Chewy_Louie

New Members
  • Posts

    5
  • Joined

  • Last visited

Chewy_Louie's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for your input. I'm not a serious programmer, so my code to you professionals like you may like offensive or down right disgusting (I'v been told that before on other forums) lol. I just create desktop programs, and web programs as i need them for self use and they do what i need them to do (PHP been about 14 years since i messed with it so really really rusty). btw looking at your code, im sure i can pick up some stuff from it and some google searching as well. Thanks.
  2. Thanks for the reply! I'm working with the PayPal ipn notification api. They give me that datetime format and i just store it in the row in my database i named "timedate" all i need to do is get the "Aug" out of the value, and assign the number value to the month. which in this case $str_month would end up = 9 after going through the if statements, but its just not finding a match, and $str_month ends up still being "Aug" even after going through all the if statements.
  3. Ok guys im new to php taught myself years back, and now decided to build a script that i needed so really rusty and just learning and remembering as i go along. Ok basically I'm having trouble seeing if a varible = value in a if statement. See code below. Basically im using the explode function to parse => $row['timedate'] witch always looks something like this => "14:02:30 Aug 20, 2016" and im putting in the values into the $date_array varible. Then im adding the value of $date_array[2] to $str_month which now holds the month. Which in this case would be "Aug" it then goes to the if statements and should assign the the text month value to its numeric value, but its just not doing it. What im i doing wrong? I just cant seem to get this to work! It should be fairly simple but im lost. Looking forward to hearing back. Thanks. $date_array = explode(" ",$row['timedate']); $str_month = $date_array[2]; if ($str_month == 'Jan') { $str_month = '1'; } if ($str_month == 'Feb') { $str_month = '2'; } if ($str_month == 'Mar') { $str_month = '3'; } if ($str_month == 'Apr') { $str_month = '4'; } if ($str_month == 'May') { $str_month = '5'; } if ($str_month == 'June') { $str_month = '6'; } if ($str_month == 'July') { $str_month = '7'; } if ($str_month == 'Sept') { $str_month = '9'; echo "its sept"; } if ($str_month == 'Oct') { $str_month = '10'; } if ($str_month == 'Nov') { $str_month = '11'; } if ($str_month == 'Dec') { $str_month = '12'; }
×
×
  • 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.