I have a string like this one
$sitesinfo = 'site 1 titles-example1.com/
site 2 titles-example2.com/
site 3 titles-example3.com/
site 4 titles-example4.com/
site 5 titles-example5.com/';
I used to split lines into 1 array like this
$lines = explode("/",$sitesinfo);
then while I loop I got each line into an array object without problems.
What do I need to do to split each line into 2 pieces and add each piece into an array so the result be like this
$titles = array("site 1 titles","site 2 titles","site 3 titles","site 4 titles","site 5 titles");
$domains = array("example1.com","example2.com","example3.com","example4.com","example5.com");
so I can use them in script.
fscanf($handle, '%[^-]-%[^/]', $titles[], $domains[])
comes to mind.