Jump to content

Search the Community

Showing results for tags 'filter'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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 (Dreamweaver, Zend, 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. I would like to create an array from the one below that can sort of filter using date ranges; For example, make an array that contains data using date <= 2018-05-09 without a loop. A loop is an option just wondering if you can filter by keys somehow. Array ( [2018-04-23 21:31:40] => -1.174 [2018-04-24 15:43:59] => -1.015 [2018-04-26 00:14:10] => -0.37 [2018-04-30 18:41:51] => -1.042 [2018-05-01 20:08:40] => -0.72 [2018-05-02 22:11:52] => -0.107 [2018-05-07 18:40:12] => -0.298 [2018-05-09 16:35:38] => -0.36 [2018-05-10 01:14:27] => 0.408 [2018-05-14 20:49:54] => 1.549 )
  2. Folks, Can you figure-out why the following script fails to find the banned words on the page when the banned words are listed in an array ? <?php /* ERROR HANDLING */ //declare(strict_types=1); ini_set('display_errors', '1'); ini_set('display_startup_errors', '1'); error_reporting(E_ALL); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); // 1). $curl is going to be data type curl resource. $curl = curl_init(); // 2). Set cURL options. curl_setopt($curl, CURLOPT_URL, 'https://www.buzzfeed.com/mjs538/the-68-words-you-cant-say-on-tv?utm_term=.xlN0R1Go89#.pbdl8dYm3X'); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true ); // 3). Run cURL (execute http request). $result = curl_exec($curl); $response = curl_getinfo( $curl ); if( $response['http_code'] == '200' ) { //Set banned words. $banned_words = array("Prick","Dick","Fag"); //Separate each words found on the cURL fetched page. $word = explode(" ", $result); //var_dump($word); for($i = 0; $i <= count($word); $i++){ foreach ($banned_words as $ban) { if (stripos($word[$i],$ban) !== FALSE){ echo "word: $word[$i]<br />"; echo "Match: $ban<br>"; }else{ echo "word: $word[$i]<br />"; echo "No Match: $ban<br>"; } } } } // 4). Close cURL resource. curl_close($curl); Remember the banned words exist on the page. And No. It is not because the banned words are not text but imgs as I checked the source code of the page and the banned words do exist as text. Check it out yourself, if you have any doubts. I hope it is not because this was set to false: curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); Setting it to "true", how-ever, shows a complete blank page. Why ? Must it not be set to "true" since the page is "httpS" anyway!
×
×
  • 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.