LMSouq

Knowledge Base

Browse Moodle Solutions

Clear

366 solutions found in php-dev

Page 16 of 19
0 votes
1 ans
3 views
What is thread safe or non-thread safe in PHP?

I saw different binaries for PHP, like non-thread or thread safe? What does this mean? What is the difference between these packages?

php-dev Solved
O.
asked 1 month ago by O..
0 votes
1 ans
3 views
Get the full URL in PHP

I use this code to get the full URL: $actual_link = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; The problem is that...

php-dev Solved
DI
asked 1 month ago by DiegoP.
0 votes
1 ans
3 views
How do I convert a string to a number in PHP?

I want to convert these types of values, `'3'`, `'2.34'`, `'0.234343'`, etc. to a number. In JavaScript we can use `Number()`, but is th...

php-dev Solved
SA
asked 1 month ago by Sara
0 votes
1 ans
3 views
What is the difference between single-quoted and double-quoted strings in PHP?

I'm a little confused why I see some code in PHP with string placed in single quotes and sometimes in double quotes. I just know in .NET, or the C langua...

php-dev Solved
RO
asked 1 month ago by rob waminal
0 votes
1 ans
3 views
How to check if PHP array is associative or sequential?

PHP treats all arrays as associative, so there aren't any built in functions. Can anyone recommend a fairly efficient way to check if an array *"is a l...

php-dev Solved
WI
asked 1 month ago by Wilco
0 votes
1 ans
3 views
How can I get a file's extension in PHP?

This is a question you can read everywhere on the web with various answers: $ext = end(explode('.', $filename)); $ext = substr(strrchr($file...

php-dev Solved
BI
asked 1 month ago by Bite code
0 votes
1 ans
3 views
Remove trailing delimiting character from a delimited string

What is fastest way to remove the last character from a string? I have a string like a,b,c,d,e, I would like to remove the last ',' and get...

php-dev Solved
I-
asked 1 month ago by I-M-JM
0 votes
1 ans
3 views
How can I calculate the difference between two dates using PHP?

I have two dates of the form: ```lang-none Start Date: 2007-03-24 End Date: 2009-06-26 ``` Now I need to find the difference between these two in the f...

php-dev Solved
GN
asked 1 month ago by gnanesh
0 votes
1 ans
3 views
How to fix "Headers already sent" error in PHP

When running my script, I am getting several errors like this: > Warning: Cannot modify header information - headers already sent by (**output started at...

php-dev Solved
MO
asked 1 month ago by Moses89
0 votes
1 ans
3 views
Get first key in a (possibly) associative array?

What's the best way to determine the first key in a possibly associative array? My first thought it to just foreach the array and then immediately breaking...

php-dev Solved
AL
asked 1 month ago by Alex S
0 votes
1 ans
3 views
How do I send a POST request with PHP?

Actually I want to read the contents that come after the search query, when it is done. The problem is that the URL only accepts `POST` methods, and it does not...

php-dev Solved
FR
asked 1 month ago by Fred Tanrikut
0 votes
1 ans
3 views
Pretty-Printing JSON with PHP

I'm building a PHP script that feeds JSON data to another script. My script builds data into a large associative array, and then outputs the data using `jso...

php-dev Solved
ZA
asked 1 month ago by Zach Rattner
0 votes
1 ans
3 views
How to fix "Incorrect string value" errors?

After noticing an application tended to discard random emails due to incorrect string value errors, I went though and switched many text columns to use the `utf...

php-dev Solved
BR
asked 1 month ago by Brian
0 votes
1 ans
3 views
Laravel-5 'LIKE' equivalent (Eloquent)

I'm using the below code to pull some results from the database with Laravel 5. BookingDates::where('email', Input::get('email'))-&gt...

php-dev Solved
V4
asked 1 month ago by V4n1ll4
0 votes
1 ans
3 views
PHP PDO: charset, set names?

I had this previously in my normal mysql_* connection: mysql_set_charset("utf8",$link); mysql_query("SET NAMES 'UTF8'");...

php-dev Solved
KA
asked 1 month ago by Karem
0 votes
1 ans
3 views
phpMyAdmin - Error > Incorrect format parameter?

I have a WordPress production website. I've exported the database by the following commands: `select database > export > custom > select all tab...

php-dev Solved
HE
asked 1 month ago by Henry
0 votes
1 ans
3 views
How Can I Set the Default Value of a Timestamp Column to the Current Timestamp with Laravel Migrations?

I would like to make a timestamp column with a default value of `CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP` using the Laravel Schema Builder/Migrations. I h...

php-dev Solved
JO
asked 1 month ago by JoeyD473
0 votes
1 ans
3 views
Laravel Unknown Column 'updated_at'

I've just started with Laravel and I get the following error: > Unknown column 'updated_at' insert into gebruikers (naam, wachtwoord, > u...

php-dev Solved
LO
asked 1 month ago by Loko
0 votes
1 ans
3 views
How to generate a create table script for an existing table in phpmyadmin?

How can I generate a create table script for an existing table in phpmyadmin?

php-dev Solved
MA
asked 1 month ago by Marko Cakic
0 votes
1 ans
3 views
Laravel Migration Error: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

**Migration error on Laravel 5.4 with `php artisan make:auth`** > [Illuminate\Database\QueryException]...

php-dev Solved
IM
asked 1 month ago by imbakar