Ok I tried to google it but couldn't find a solution so I am asking here. I am trying to save the HTML tags into a variable in php. I am trying to use preg_match but cannot find the right pattern(regex). I did find one regex '\s*(.*?)\s*>\s*'
. This works ok on the functions-online site where I try it and gives me the whole tag i.e.i=<body>
but when I try to run it in my programme I get
preg_match(): Delimiter must not be alphanumeric or backslash
It would be helpful if anyone could sort out this issue and even better if anyone could give the regex to get the data within the angle brackets(HTML tags)
Please also let me know if there is another method to store the html tags in php i.e.
<body>
then $var=body