Jump to content

Need help with a pattern


scuarplex

Recommended Posts

Hello, i need to use several ips for an applications and my idea it's to convert them from a text file, to a string and then to an array.

 

My txt would be something like this:

127.0.0.1:21

66.97.171.5:80

192.0.100.1:8080

 

So now i have the string, and i was thinking to use preg_split() to convert it into an array.

 

My problem is that patterns are a total mystery to me and i have no clue how to make one.

I would basically would need a pattern to split the string on every /n

 

Link to comment
https://forums.phpfreaks.com/topic/214443-need-help-with-a-pattern/
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.