INVP::extract_image_element_src( string $img_element )
Given a string containing HTML <img>
element markup, extract the value of the src attribute and return it.
On This Page
Parameters Parameters
- $img_element
-
(string) (Required) An HTML <img> element.
Return Return
(string) The value of the src attribute
Source Source
File: includes/class-invp.php
public static function extract_image_element_src( $img_element ) { return preg_replace( '/">?.*/', '', preg_replace( '/.*<img[\s\S]+src="/', '', $img_element ) ); }
Expand full source codeCollapse full source codeView on Github