base64 encode GET variables in PHP

PHP
I am trying to get php to encode after = but before &. $actual_link = "$_SERVER[REQUEST_URI]"; $out = substr(strstr($actual_link, '?'), strlen('?...
1 year ago

Using a regular expression to validate an email address

PHP
Over the years I have slowly developed a regular expression that validates MOST email addresses correctly, assuming they don't use an IP address as th...
1 year ago

Getting an accurrate Results from Personality Test

PHP
What is wrong with this code, need ideas Thanks. I have Used another Method which was fine for me, but my head of my Team said it was not Okay, becaus...
1 year ago

How to test namespaced objects in Laravel 4 with phpunit

PHP
I'm organizing my tests folder to reflect the namespaced objects and interfaces in my app. However, I've been running into nothing but trouble trying ...
1 year ago

php count the number of strings after exploded

PHP
Here is my code <?php $string = 'a|b|c|d|e|f'; $tags = explode('|' , $string); foreach($tags as $i =>$key) { $i >0; echo $i.' '.$key...
1 year ago

Localhost Error with Laravel 5.1 on Ubuntu 14.04

PHP
Have had a look at previous articles here, but with no luck. I've just installed Laravel 5.1 via composer. I've been following the official documentat...
1 year ago

My php script output a json array that starts as [[],

PHP
I have this php script which should output a json array, it does that but my json array start with [[], why this two additional square brackets [] ? ...
1 year ago

Insert Text Field Name or ID as Value in MySQL Column

PHP
In my extremely limited development experience, when I submit a form, usually the name or ID of an input value corresponds with a column in a MySQL ta...
1 year ago

Class 'App\Providers\AppServiceProvider' not found

PHP
I have changed my application by using command php artisan app:name [app_name]. Then, when I try to perform other actions using following artisan ...
1 year ago

PHP while() loops breaks early?

PHP
I recently ran into a strange problem where a MySQL while() loop breaks early, and does not continue the loop for each student iteration. My code: &...
1 year ago

PHP function to convert special characters to unicode(UTF-16)

PHP
Is there a PHP function that can take a string and convert any special characters to unicode. Similar to htmlspecialchars() or UTF8_encode(). For exa...
1 year ago

How to filter associative array by values and split into two variables?

PHP
I am trying to filter an associative array so that certain values within a specific key will go into a specific variable. To make sense of this, here ...
1 year ago

Matching text between braces in PHP

PHP
In direct follow-up to this previous question, how can I pull the text (and the braces if possible) out as a match using PHP? Specifically, I am writ...
1 year ago

What is the purpose of declaring variables in a class

PHP
What is the purpose of declaring a variable at the top of a class if it works without it? class Testclass { public $testvar = "default value"; ...
1 year ago

using <select> to sort mysql database but nothing happens

PHP
Here is my MySQL code: $sql = "SELECT * FROM ProductManagement ORDER BY ID ASC;"; $result = $connection-&gt;query($sql); if ($result-&gt;num_rows &...
1 year ago

CakePHP 3: How to display sum of values in column from finder results

PHP
CakePHP: 3.1.4 I could not find any helpful example on this, so I'm sorry if a similar question has been asked before. I have a custom finder funct...
1 year ago

mysql_fetch_array() expects parameter 1 to be resource (or mysqli_result), boolean given

PHP
I am trying to select data from a MySQL table, but I get one of the following error messages: mysql_fetch_array() expects parameter 1 to be resour...
1 year ago

Sending a calendar value using POST into next page

PHP
I have an &lt;input type="date" name="Date"/&gt; in my &lt;form method="post" ... &gt;, and I want to take the selected value from this calendar trans...
1 year ago

Codeigniter returns no rows of any sqlite3 table

PHP
I am a beginner (more or less 1 month) in CodeIgniter and I'm trying to make it work with a sqlite3 database, and I'm stumped. What am I missing? I u...
1 year ago

Warning: Division by Zero in PHP

PHP
https://ctrlv.cz/c7pu The error I am receiving, I don't understand why though. I have a feeling that it is something to deal with the $bank variable ...
1 year ago