Jump to content

lilnow

New Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

lilnow's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. INSERT INTO test.pm (`to`, `from`, `message`, `date`) VALUES ('alex', 'alex', 'Bored!', '2011-03-30 04:30:00') I agree with Thorpe, your table names could be better.
  2. Thanks for the suggestion Crayon Violet. I merged the four variables and ended up with this - and it works! '/^(((feb)\-((0[1-9])|([12][0-9])))|((apr|jun|sep|nov)\-((0[1-9])|([12][09])|30))|((jan|mar|may|jul|aug|oct|dec)\-((0[1-9])|([12][09])|(3[01]))))\-((19[0-9][0-9])|(20((0[0-9])|(1[01]))))$/i';
  3. This may not be exactly what you are looking for, but hope it helps: $array = your image array here $rowHtml = ""; foreach($array as $filename){ $rowHtml = $rowHtml . "<ul>"; $rowHtml = $rowHtml . "<li><a href=\"$filename\">$filename</a></li>"; $rowHtml = $rowHtml . "</ul>"; } print $rowHtml;
  4. Hi I am new to php and regex. I have a school exercise - I'm pretty sure the problem is in my $match variable, but lack the experience to see where I have gone wrong. I get a "Delimiter must not be alphanumeric or backslash". Any suggestions would be appreciated. Thanks. // format for birthday of MMM-DD-YYYY. The year cannot be later than the current year. $birthdate = $_GET["birth"]; $birth31days="/^(JAN|MAR|MAY|JUL|AUG|OCT|DEC)-([0-2][0-9] | [3][01])$/i"; $birth30days="/^(APR|JUN|SEP|NOV)-([0-2][0-9] | [3][0])$/i"; $birth29days="/^(FEB)-([0-2][0-9])$/i"; $years="/^19[0-9][0-9 ]$| ^20(0[0-9]| 1[01])$/"; $match = (($birth31days|$birth30days|$birth29days)-($years)); echo $match; $birthRegex = $match; if (preg_match($birthRegex, $birthdate)){ <-- error message implies it's here echo "Birthday: $birthdate <br />"; } else{ echo "Format incorrect. You entered $birthdate. Please go back and try again <br />"; }
×
×
  • 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.