Jump to content

mallen

Members
  • Posts

    316
  • Joined

  • Last visited

Community Answers

  1. mallen's post in using Strrchr to get end of string was marked as the answer   
    $THEURL = "SELECT Image_URL From ... ect";//the query

    $image = $wpdb->get_row($THEURL, ARRAY_A);//the variable is dynamic

    var_dump(substr(strrchr($image,'/'),1)); fails

    var_dump(substr(strrchr('http://somewebsite.com/images/image1.jpg','/'),1)); gives 'image1.jpg'

    var_dump($image); // gives 'http://somewebsite.com/images/image1.jpg'


    I figured it out:

    var_dump(substr(strrchr($image['Image_URL'],'/'),1));
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.