"Quote in quotations then" - Author <<<<<
I would like to write a script that splits the authors from the quotes. Here is where I'm at:
$quotesfile = "http://localhost/projects/quotes_list/quotes.txt"; $handle = fopen($quotesfile, 'rb'); $quotes = fread($handle, 1024); $pattern = '/\"[A-Za-z0-9]\"/'; $quotes = preg_split($pattern, $quotes); print_r($quotes);
This prints out as follows:
Array (  => "We're going to go pull the call girl cards out of phone boxes." - Lisa Pruden "I think I left lippy on you." - Olga Bof "In the end I just pretended to take it, and then spat it out later" - Sasha Breslau "He likes a bit of chav." - Lauren Dunn "She responds well to Toblerone." - Stephen Hardingham "Everything in the world is on my little pink stick." - Jon Holmes "I'm not sure I want a wanking cat on a Friday afternoon." - Dom Eames "I like the idea of extreme cunninglingus." - Mandy Pollard "I'm trying to think of a retort to say I've got a huge cock, but I can't." - Scott Dingley "It's a man's place Lelia. It's supposed to be dirty." - Jon Salt "Do you want me to sit on you?" - Emma Williams "I don't dream about badgers." - Mark Limb "Did no-one see I just punched that girl? I feel like a wife beater." - Jon Salt The quotes list says goodbye to Paul "temple of meat" Sigaloff. Here are Paul's best bits: "I have to manage my own expectations." "Ok good - let's have a meeting, but don't )
I have tried a couple variations of a while and foreach loop, but each time I try one, I get no results at all. Either I get :
Array (  => )
or there are no results whatever.
Can anyone let me know how to use the preg_split better so as to store the quotes and authors into the keys and values of an array, so that I can work with them more easily?
Any advice greatly appreciated! :-\