Good day to all masters here.. good to be back here again and nice site!
ok, i have a problem and still confusing to accomplish using 2 values in preg match. here is my sample code...
Ok, now the problem here is i don't know where can place or even the better code to place the $value2 inside the preg_match.
or i will need to create another set of preg_match for $value2?
i'm open for your all helps and suggestions.. appreciation to all your help.
ok, i have a problem and still confusing to accomplish using 2 values in preg match. here is my sample code...
Code:
<?php
$value1 = $_POST['value1'];
$value2 = $_POST['value2'];
//Post Value in Text Field for Value 1
$text1 = /(Text1, Word1)/i";
$text2 = /(Text2, Word2)/i";
//Post Value in Text Field for Value 2
$text3 = /(Text3, Word3)/i";
$text4 = /(Text4, Word4)/i";
if (preg_match( $text1, $value1 )) {
$mail->AddAddress('webmail1@localhost.com');
} elseif (preg_match( $text2, $value1 )) {
$mail->AddAddress('webmail2@localhost.com');
} else {
$mail->AddAddress('webmail@localhost.com');
}
?>
or i will need to create another set of preg_match for $value2?
i'm open for your all helps and suggestions.. appreciation to all your help.
Comment