About Me
 
- lakhvinder kulrian
- Kulrian/Bareta, Punjab, India
- I am simple and coool boy.
Friday, 20 November 2009
Thursday, 19 November 2009
ExtractEmails in PHP
$content=file_get_contents("emails.txt");
$emailArray=$result=array();
$pattern="/[^a-zA-Z0-9\.]+?([a-zA-Z0-9\.]+@[a-zA-Z0-9\.-]+)[^a-zA-Z0-9\.]/Uis";
preg_match_all($pattern, $content, $result, PREG_SET_ORDER);
$result=array_unique($result);
$result=array_values($result);
print_r($result); die;
$c=count($result);
for($i=0;$i<$c;$i++){
$emailArray[]=trim($result[$i][1]);
}
echo print_r($emailArray);
?>
How to Create a Calendar Using PHP | eHow.com
-          Step 1Follow the PHP Calendar Source link in Resources. This will display PHP code. Copy it by highlighting and pressing "Ctrl" + "C." 
-          Step 2Open your php file editor to paste the code into a new php file. Be certain that you're saving your file and type php. 
-          Step 3Save the file as "calendar.php," but don't close the file. This code won't actually show a calendar just yet, but it's the code the calendar will use. 
-          Step 4Go to the bottom of the file and paste the following code before the final ?> (question mark and greater than symbol) at the end of the file. 
 // Construct a calendar to show the current month
 $cal = new Calendar;
 echo $cal->getCurrentMonthView();
-          Step 5Test the file by uploading it to your web server with your file upload program. You will see a very simple calendar with the current month displayed and the current date highlighted. 
 You calendar is created.
-          Step 1Add the following CSS style blocks to the beginning of your file before the opening 
-          Step 2Change the color of your calendar's header by changing the follow CSS style declaration from Step 1. 
 calendarHeader {font-weight: bolder; color: #CC0000; background-color: #FFFFCC;}
 You can replace the hexadecimal color #FFFFFF for the background with natural name colors like "red," "white," "blue."
 You can do the same to replace the hexadecimal colors #CC0000 for the header's text color.
-          Step 3Change the color of the current date highlight by changing the follow CSS style declaration from Step 1. 
 calendarToday {background-color: #FFFFFF;}
 Replace the hexadecimal color #FFFFFF for the background with natural name colors or other hexadecimal values.
-          Step 4Change the background color of the whole calendar by changing the following CSS style declaration in Step 1. 
 calendarToday {background-color: #FFFFFF;}
 Replace the hexadecimal color #FFFFFF for the background with natural name colors or other hexadecimal values.
 If you want to see a broader range of hexadecimal colors, visit the "Hexadecimal Color" link in Resources.
-          Step 1Find the following block of code in your calendar.php file (this should be around line 418). 
 // Construct a calendar to show the current month
 $cal = new Calendar;
 echo $cal->getCurrentMonthView();
-          Step 2Replace the code with the following code block. 
 class MyCalendar extends Calendar { function getCalendarLink($month, $year) {
 // Redisplay the current page, but with some parameters
 // to set the new month and year
 $s = getenv('SCRIPT_NAME'); return "$s?month=$month&year=$year"; } }
-          Step 3Add the following code block to the end of the calendar.php file after all other code. 
 $d = getdate(time());
 if ($month == "") {
 $month = $d["mon"]; }
 if ($year == "") {
 $year = $d["year"]; }
 $cal = new MyCalendar;
 echo $cal->getMonthView($month, $year);
 ?>
-          Step 4Test your new customized calendar by uploading calendar.php to your web server. Your calendar will show the current month with date highlighted. You can now navigate through the months. 
-          Step 1Open the web page you want to integrate your new calendar into. For this to work, the file in which you want to integrate the calendar must also be a php file. 
-          Step 2View the code of your file and paste the following code where you want your new calendar to appear. 
 include ("calendar.php");
 ?>
-          Step 3Put your calendar.php in the same folder/directory as your web pate that will display the calendar. 
 
