Transform regex from Ruby to PHP by peterjuel

Hi, I need the following 3 line Ruby snippet to be transformed to PHP text.gsub!(/(\A|^$\n)(^\w[^\n]*\n)(^\w[^\n]*$)+/m) do |x| x.gsub(/^(.+)$/, “\\1 “) end The PHP function should perform in exactly the same way… (Budget: $30-$250 USD, Jobs: PHP, Ruby & Ruby on Rails)


Leave a Reply

Your email address will not be published. Required fields are marked *