Somehow a variable that SHOULD contain only one string (not an array or anything) contain an url, managed to contain two different values;
string(8) "value 1 " string(7) "value 2"
i cannot use this variable because echoing it or using it in another function would print
value 1 value2
which is not what i need, i need only value 1 and i cannot use $var[0]
Two things; how can i do something similar (one variable two strings), and how can i manipulate it. EDIT : here is the code
public function get_first_image($post) {
$image_id=get_post_thumbnail_id($post->id);
$image_url = wp_get_attachment_image_src($image_id,’large’);
$image_url=$image_url[0];
var_dump($image_url);
return $image_url;
}
the var_dump() results are as mentioned above
Best Regards