Thanks for the help people
I also got this useful answer from NogDog a few minutes ago
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang='en'>
<head>
<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'>
<title>Untitled</title>
<style type="text/css">
</style>
</head>
<body>
<?php
$test = <<<EOD
<submit value='submit' onClick="this.is.a.('test');it.is.only.a('test');">
EOD;
echo "<p>Initial string: <strong>". htmlentities($test) . "</strong></p>\n";
preg_match("/onclick=[\"\'](.*;)[\"\']/i", $test, $matches);
echo "<p>Result of preg_match: <strong>{$matches[1]}</strong></p>\n";
?>
</body>
</html>
Bookmarks