Jump to content

Search the Community

Showing results for tags 'stristr'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 1 result

  1. I'm trying to filter out the rows of a uploaded csv that have the word "lokaal" (classroom) in the 3th colom, but this doesn't work. What does work: When I search for just one letter (for example the o) $findneedle is true, so it works Putting $haystack="lokaal 5"; in the coding also works (but that is just usable for testpurposes) echo $haystack does result in a correct value, so the csv is read correctly <? $handle = fopen($_FILES['file']['tmp_name'], "r"); $data = fgetcsv($handle, 1000, ";"); //Remove if CSV file does not have column headings while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) { $haystack=$data[2]; $needle='lokaal'; $findneedle=strpos($needle, $haystack); if($findneedle !== false) { //rest of the coding } ?> The CSV looks like this 2013;Class 1;Zelfstudie;31-12-2013 0:00:00;1-1-1900 9:00:00;1-1-1900 12:00:00; 2013;Class 2;lokaal 5;27-12-2013 0:00:00;1-1-1900 15:00:00;1-1-1900 17:00:00; Am I overlooking something? I hope someone can help me.
  • 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.