Skip to main content
replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
Source Link

you can use regular expression on your post content.Which could be done for example like this:

for referencereference

$content = get_the_content();
// we need a expression to match things
$regex = '/src="([^"]*)"/';
// we want all matches
preg_match_all( $regex, $content, $matches );
// reversing the matches array
$matches = array_reverse($matches);
echo '<pre>';
// we've reversed the array, so index 0 returns the result
print_r($matches[0]);
echo '</pre>';

you can use regular expression on your post content.Which could be done for example like this:

for reference

$content = get_the_content();
// we need a expression to match things
$regex = '/src="([^"]*)"/';
// we want all matches
preg_match_all( $regex, $content, $matches );
// reversing the matches array
$matches = array_reverse($matches);
echo '<pre>';
// we've reversed the array, so index 0 returns the result
print_r($matches[0]);
echo '</pre>';

you can use regular expression on your post content.Which could be done for example like this:

for reference

$content = get_the_content();
// we need a expression to match things
$regex = '/src="([^"]*)"/';
// we want all matches
preg_match_all( $regex, $content, $matches );
// reversing the matches array
$matches = array_reverse($matches);
echo '<pre>';
// we've reversed the array, so index 0 returns the result
print_r($matches[0]);
echo '</pre>';
Source Link
sohan
  • 407
  • 1
  • 4
  • 11

you can use regular expression on your post content.Which could be done for example like this:

for reference

$content = get_the_content();
// we need a expression to match things
$regex = '/src="([^"]*)"/';
// we want all matches
preg_match_all( $regex, $content, $matches );
// reversing the matches array
$matches = array_reverse($matches);
echo '<pre>';
// we've reversed the array, so index 0 returns the result
print_r($matches[0]);
echo '</pre>';