Jump to content

rookwood

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by rookwood

  1. I am trying to split some strings up by commas with preg_split but I keep on getting the error: "No ending delimiter ',' found" Here is my Code: $links = preg_split(',', $links); $titles = preg_split(',', $titles); $images = preg_split(',', $images); Thanks, Alex
  2. Its supposed to display the text in the file with separated title and story bits which have there tags removed
  3. <html> <head> <title>Browns - Design Needs</title> <link type="text/css" rel="stylesheet" href="style.css"> <link rel="SHORTCUT ICON" href="favicon.ico"/> <!--PHP News Finder--> <?php $file = 'news.txt'; $data = file ($file) or die ('Could Not Read News File.'); $lines = count (file ($file)) - 1; str_replace ("<title>", " ", $data[1]); $line = 2; while ($lines > $line) { str_replace ("<story>", " ", $data[$line]); $line = $line + 1; } $line = 2; while ($lines > $line) { $story = $story + $data [$line]; $line = $line + 1; } $neweststory['title'] = $data[1]; $neweststory['story'] = $story; ?> </head> <body> <div id="header"> </div> <div id="nav"> <ul> <li><span><a href="#">Home</a></span></li> <li><a href="#">About</a></li> <li><a href="#">Links</a></li> <li><a href="#">Resources</a></li> </ul> </div> <div id="main"> <div id="main_text"> <h2>Home</h2> <p> Hello this is Browns Design the site for designs. </p> </div> <div id="side_news"> <h2>News</h2> <div id="box"> <h3><?php echo $neweststory['title']; ?></h3> <?php echo $neweststory['story']; ?> </div> </div> </div> </body> </html> There's something wrong with this code and I can't work out what, I'm a bit of a beginner so please help. It doesn't throw an error so its not that bad but it doesn't work still. You can see it in action here: http://sadler-designs.cwahi.net/Simple/ Thanks In advanced, Alex
×
×
  • 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.