


function isValidEmail($email){

return preg_match("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$^",$email);
}

echo '<h3>a preg_match() function first...</h3>';

$result1=isValidEmail('ali@gmail.com')?'valid': 'not valid';
echo 'ali@gmail.com is'.$result1;

$result2=isValidEmail('ali@gmail.com.travel')?'valid': 'not valid';
echo 'ali@gmail.com is'.$result2;



********************************************************





<?php echo doctype('html5');?>

<html> lang="en">
<head>

	<?php echo meta('description','My CI site');
	$meta=array(
		array('name'=>'robots','content'=>'no-cache'),
		array('name'=>'keywords','content'=>'php,mysql,oop,Mvc'),
		array('name'=>'content-type','content'=>'text/html;charset-utf-8','type'=>'equiv')
	);
	echo meta($meta);
	$title="welcom";
	?>


	<title><?php echo $title ?></title>
	<?php echo link_tag('resources/style.css');?>

</head>
<body>
<div id="conteiner">
	<h2><?php echo $page_header ?></h2>
	<div id="body">
		<?php
		echo heading('Hello World',3);
		echo heading('Hello World',5);
		echo heading('Hello World',4,'class="important"');
		echo img('1.jpg');



		$image_attr=array(

			'src'=>'1.jpg',
			'alt'=>'logo',
			'height'=>'35',
			'title'=>'proseatCovers Logo'

		);

		echo br();
		echo img($image_attr);
		echo br();
		echo nbs(5).'I hae 5 space before me.<br/>';



		$list=array(
			'red',
			'blue',
			'green',
			'yellow'
		);

		$attributes=array(
			'class'=>'list',
			'id'=>'mylist'

		);

		echo ul($list,$attributes);








		$attributes = array(
			'class' => 'boldlist',
			'id'    => 'mylist'
		);

		$list = array(
			'colors'  => array(
				'red',
				'blue',
				'green'
			),
			'shapes'  => array(
				'round',
				'square',
				'circles' => array(
					'ellipse',
					'oval',
					'sphere'
				)
			),
			'moods'  => array(
				'happy',
				'upset' => array(
					'defeated' => array(
						'dejected',
						'disheartened',
						'depressed'
					),
					'annoyed',
					'cross',
					'angry'
				)
			)
		);
		echo ul($list, $attributes);





		?>


	</div>

</div>

</body>

</html>