Friday 1 March 2019

php - Regexp for html








I have the following string:



$str = " 
  • r

  • a

  • n

  • d

  • ...
  • om

  • ";



    How do I get the HTML for the first n-th

  • tags?



    Ex : n = 3 ; result = "
  • r<...>n
  • ;


    I would like a regexp if possible.

  • No comments:

    Post a Comment

    php - file_get_contents shows unexpected output while reading a file

    I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...