Jump to content

[SOLVED] Using multiline


Lumio

Recommended Posts

Hi!

I have a string like

foo=bar xy*21
bar=foo ***//
here - it ends
to the	next row

Now, when I try to make it like this...

<?php
preg_match('{(.+?)\-(.+)}', $s, $match);
print_r($match);
?>

... it only puts out

Array
(
    [0] => here - it ends
    [1] => here 
    [2] =>  it ends
)

But I want to get something like

Array
(
    [0] => foo=bar xy*21
bar=foo ***//
here - it ends
to the	next row
    [1] => foo=bar xy*21
bar=foo ***//
here 
    [2] =>  it ends
to the	next row
)

Link to comment
https://forums.phpfreaks.com/topic/46565-solved-using-multiline/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.