PHP regex pattern for matching all

PHP
I have a-facebook-like mentioning feature in my app. When creating posts or comments user can mention other users with @ sign. I use following jQuery...
2 years ago

Create Loop for uploaded document in PHP

PHP
I am looking to create a loop for uploading several documents (49 to be exact!!!). I am completely new to loops so any direction or help would be gre...
2 years ago

Jquery: unable to add whitespace to the placeholder of contenteditable div

PHP
For my contetedible div, I need to use javascript to prepend some whitespace in the placeholder, in order to center the text of a flexible-length plac...
2 years ago

Getting data from a database in a datetimelocal form element on Zend framework2

PHP
I've a form set up using Zend Framework 2 with an element type 'DateTimeLocal' When I add a new record using the form all works well. When I edit a ...
2 years ago

Codeignter how to get userid after login

PHP
I have successfully created a registration and login system. I have used useremail and password in the login form and I want to display the username a...
2 years ago

PHP Regex: Difference between \s and \\s

PHP
I understand \s is used to match white space character, but sometimes I see "\\s" is used in preg match and working fine. For eg: if (preg_match("/...
2 years ago

Getting ’ instead of an apostrophe(') in PHP

PHP
I'v tried converting the text to or from utf8… didn't seem to help Im getting: "It’s Getting the Best of Me" It should be: "It’s Getting the Be...
2 years ago

How do I turn off PHP Notices?

PHP
Notice: Constant DIR_FS_CATALOG already defined I've already commented out display_errors in php.ini, but is not working. How do I make PHP to not ...
2 years ago

Remove excess commas from string PHP

PHP
I've filtered some keywords from a string, to remove invalid ones but now I have a lot of extra commas. How do I remove them so I go from this: ,,,,,...
2 years ago

substring in php whether words is first or last in string

PHP
I have this piece of PHP to find a campaign name in string and then use substr on the occurrence of the campaign name. $chars = array("æ", "ø", "å"...
2 years ago

Laravel sometimes validation rule

PHP
I am trying to validate a password field only if it is present. I want to allow someone to edit a user and they may or may not want to change the user...
2 years ago

Yii2 Basic Template UrlManager rules for web/index

PHP
I've made an REST API in the Yii2 Basic Template. For this REST API i've changed the web.php. This is what I have added: 'urlManager' => [ ...
2 years ago

preg_match php special characters

PHP
how to use preg match to see if special characters [^'£$%^&*()}{@:'#~?><>,;@|\-=-_+-¬\]` exist in a string? ...
2 years ago

Preg_replace multiple bbcodes correctly

PHP
Currenlty I'm creating a bbCodes function to replace all bbCodes by their corresponding HTML codes within a text. My code works like this atm: public...
2 years ago

Form to email in PHP delivering empty values

PHP
I'm trying to send an email with PHP using an HTML form. When I receive the email however, the name and email fields are always empty, I only receive...
2 years ago

WAMP server in green but only get 404

PHP
Alright ladies and gents. I have quite the puzzling issue. I have WAMP server installed on my WIN7 machine at work, everything was working fine and da...
2 years ago

Set waiting tone for asterisk agi function processing

PHP
I am using asterisk with normal php agi following this link the problem is that my php agi takes 5 seconds to execute .I just want to set some waiting...
2 years ago

FILTER_FLAG_STRIP_LOW vs FILTER_FLAG_STRIP_HIGH?

PHP
You know that I am talking about filter_var function in PHP 5. I have visited http://php.net/manual/en/filter.filters.sanitize.php but I still have t...
2 years ago

Prevent <br> tag at end of input string with PHP

PHP
I want to eliminate the LAST &lt;br&gt; tag that can mess up my web display after the end of the user's input string. Apparently I messed something up...
2 years ago

Mysql PHP do not show duplicate id

PHP
I want remove duplicate usernames from this query: SELECT transactions.id, transactions.user_id, transactions.dikaioma, transactions....
2 years ago