I have a string which contains :
navigation pane or double clicking folders in the details pane.
Navigating the folder structure
-------------------------------
symbol will expand or collapse folders in the navigation pane
I want to extract text only "Navigating the folder structure"
I have tried with preg_match_all but unable to handle starting point which is a new line.
I also tried with strpos but unable to do with new line as starting point.
Use a combination of
strpos
to find the line breaks, andsubstr
to extract the text between the first and second line break. This text includes the dashes (-
) so I included astr_replace
to remove them.This will print the desired text