Results 1 to 2 of 2

Thread: str_replace puzzle #2

  1. #1
    Join Date
    Apr 2012
    Location
    Central New Jersey
    Posts
    286
    Thanks
    95
    Thanked 3 Times in 3 Posts

    Default str_replace puzzle #2

    PHP Code:
    <?php
    $lastUpdate 
    date'j F Y'filemtime'pageContent/reviewActivity.txt' ) );

    $months = array (
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "October",
    "November",
    "December",
    );

    echo 
    "<br /><br /><br /><br />";
    $serverMonth date ('m');
    $serverMonth--;
    $bigData file_get_contents ($months[$serverMonth] . "Collection");        
    $bigData str_replace (" """$bigData);
    echo 
    "Here comes \$bigData:<br /><br />" $bigData "<br /><br />";
    $lineItem explode ("*"$bigData);
    foreach (
    $lineItem as $item) {
        echo 
    "Item = " $item "<br />";
    }
    ?>
    <br />
    <br />
    <a href="http://www.marainlaw.com/bottomline.php"><img border="2" src="images/marain-logo.gif" alt="" width="130" height="75" class="right" /></a>
    <br />
    <br />
    Folks,

    The code above is for https://www.marainlaw.com/page.php?here=reviewActivity. It appears that line breaks cause omission of "Item =" on the line that follows. Can someone explain why?
    Last edited by marain; 02-10-2021 at 01:36 PM. Reason: Mark "Resolved"

  2. #2
    Join Date
    Apr 2012
    Location
    Central New Jersey
    Posts
    286
    Thanks
    95
    Thanked 3 Times in 3 Posts

    Default

    Resolution was to eliminate the line breaks inserted in the script that created the file. I have no opinion as to whether the line breaks "should" have caused what I discerned originally to be a problem.

Similar Threads

  1. Resolved str_replace puzzle
    By marain in forum PHP
    Replies: 2
    Last Post: 02-08-2021, 01:13 PM
  2. Resolved str_replace Help!
    By X96 Web Design in forum PHP
    Replies: 2
    Last Post: 10-01-2009, 03:41 AM
  3. str_replace not giving correct output
    By jc_gmk in forum PHP
    Replies: 3
    Last Post: 08-14-2008, 05:16 PM
  4. Replies: 1
    Last Post: 05-21-2008, 01:09 PM
  5. mutiple str_replace?
    By lankinator in forum PHP
    Replies: 1
    Last Post: 07-21-2007, 11:21 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •