ComputerEducationWorld.com Categories:
Free Computer Books Online, PHP, PHP 5 Power Programming, C Programming, C For Beginners, Professional C sharp, INDEX - C# Professional in 15 days, Java, Java 2 (simpler way-Old version), Javascript Tutorial for Beginners, HTML, HTML for Beginners, HTML For Advanced, CSS, CSS For Beginners, CSS Advanced, Basic of Computers, Javascript, Free Web Designing Courses, Introduction to JavaScript, Javascript For Beginners, Download Free E-book, .Net, News and Alerts, Ajax, PHP Script, PHP and XML, PHP Ad Management, PHP Classes, MYSQL, Mysql Classes, Mysql Functions, Tips and tricks, Mozilla firefox tricks, Notepad tricks, Windows tricks, MS word tricks, miscellaneous tricks, HTML Tips and Tricks, PHP Tricks, PHP & MySQL, PHP and MySQL - From Beginning to Professional, INDEX, Basic of MySQL, INDEX - MySQL Basic, Wordpress, Wordpress Plugins, Webmasters, Linux/Unix, jQuery
|
Taking Value Of Attributes inside HTML Tags Using preg_match_all (eg. img src=”")
|
61 views
preg_match_all function matches given parameters inside given string,number,url as in tag we can fetch value of src and stored it in an array
Example:
-
preg_match_all(‘/ (src)(\=\’|\=\”)([a-zA-Z0-9\-\_\.\/\:]+)\’|\”/’, "<img src=’http://www.computereducationworld.com/logo.jpg’>", $ImagesArray,PREG_SET_ORDER );
-
-
-
Output:
-
-
-
-
[0] => src=‘http://www.computereducationworld.com/logo.jpg’
-
[1] => src
-
[2] => =‘
-
[3] => http://www.computereducationworld.com/logo.jpg
-
)
-
)
-
|
Post Comment
You must be logged in to post a comment.
|
|