Navigation

    ask avan logo
    • Register
    • Login
    • Search
    • Categories
    • Unsolved
    • Solved

    Exclude Text from the out put using printf

    PHP
    1
    1
    51
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MPG Radio
      MPG Radio last edited by

      I would like to exclude words from the output of printf, I think this is the correct way to go about it but the page breaks and data disappears, any suggestions thank you.

      function outputPlaylist($playlist) {
      	$entries = parse_m3u($playlist);
      	echo "<pre>\n";
      		$iDontWant1="imm/"
      		$iDontWant2="bla2"
      		$iDontWant3="bla3"
      	foreach($entries as $entry) {
      	
      		if($entry->Artist == $iDontWant1 || $entry->Artist == $iDontWant2 || $entry->Artist == $iDontWant3) continue; 	
      	
      	printf("\"%s\" by %s!\n", $entry['title'], $entry['artist']);
      	}
      	echo "</pre>";
      

      the expected output should be "British" by After Alice!
      not "British" by imm/After Alice!

      Reply Quote 0
        1 Reply Last reply

      • First post
        Last post