how do I find a value within a string in php -


My value is stored in a string (inside). I need to clear this value if it is empty.

  $ variable = "& lt; a href = \" http: //www.link-url.ext \ "& gt; My link & lt; / A & gt; (55 ) "; $ Value = "55"; // How do I get the price? If ($ value & lt; 1) {// a link} other {// show link}  

This code was used to show links to any of those posts in Wordpress Will go

  $ variable = "my link (55) plus more text"; Preg_match ('/\((.*?)\)/', $ variable matches $); $ Value = $ matches [1]; Echo $ value;  

Comments