My value is stored within a string inside (). I need to return this value to check if it’s empty.
$variable = "<a href=\"http://www.link-url.ext\">My Link</a> (55)";
$value = "55"; // how do I get the value?
if($value < 1) {
// no link
} else {
// show link
}
This code would be used to show links with no posts in them in WordPress.
1 Answer