We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9496
    • 113 Posts
    I am pulling a yahoo news feed through FeedX. The feed basically returns this:

    Hello world (author)

    I was figuring that all I need to do is separate everything out with a PHX modifier. I’ve gotten it to work (mostly) but I am unsure how to strip the parenthesis from the result.

    I figured the best approach would be to explode the $output into an array and then try to go from there.

    My modifier looks like this...
    <?php
    $input = $output;
    $item = explode("(", $input);
    
    $content = $item[0];
    $author = "<span class=\"source\">".$item[1]."</span>";
    
    echo $content.$author; 
    ?>


    I’m still working on getting my PHP up to speed so any help would be greatly appreciated -- Thanks!
      • 9496
      • 113 Posts
      I figured it out. The jury is still out on the logic, however.

      Heres my final result:

      <?php
      $input = $output;
      $item = explode("(", $input);
      
      $title = $item[0];
      $source = trim($item[1],")");
      
      echo $title."<span class=\"source\">".$source."</span>";
      ?>