Asked  7 Months ago    Answers:  5   Viewed   48 times

How can I use preg_match to see if special characters [^'£$%^&*()}{@:'#~?><>,;@|-=-_+-¬`] exist in a string?



[W]+ will match any non-word character.

but to match only the characters from the question, use this:

  if(preg_match("/[[^'£$%^&*()}{@:'#~?><>,;@|\-=-_+-¬`]]/", $string)){
   //this string contain atleast one of these [^'£$%^&*()}{@:'#~?><>,;@|-=-_+-¬`] characters
Wednesday, March 31, 2021
answered 7 Months ago

Changed the HTML charset to ISO-8859-1 fixed the problem! Silly

Wednesday, March 31, 2021
answered 7 Months ago

You should point to your vendor/autoload.php at Settings | PHP | PHPUnit when using PHPUnit via Composer.

This blog post has all the details (with pictures) to successfully configure IDE for such scenario:

Related usability ticket:

P.S. The WI-18388 ticket is already fixed in v8.0

Wednesday, March 31, 2021
answered 7 Months ago

On Mac OS X environment variables available in Terminal and for the normal applications can be different, check the related question for the solution how to make them similar.

Note that this solution will not work on Mountain Lion (10.8).

Saturday, May 29, 2021
answered 5 Months ago
  1. Make sure you set the headers to UTF-8:

    header('Content-Type: application/json; charset=utf-8');
  2. Make sure your connection to database is made with UTF-8 encoding before any queries:

    $query = mysql_query("SET NAMES 'UTF8'");
  3. As far as I know, JSON encodes any characters that cannot be represented in pure ASCII. And you should decode that JSON on response.

  4. Try to move to PDO as mysql_* functions are deprecated. Use this nice tutorial

Saturday, May 29, 2021
answered 5 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :