LMSouq

Knowledge Base

Browse Moodle Solutions

Clear

366 solutions found in php-dev

Page 18 of 19
0 votes
1 ans
3 views
How to place the ~/.composer/vendor/bin directory in your PATH?

I'm on Ubuntu 14.04 and I've been trying all possible methods to install Laravel to no avail. Error messages everything I try. I'm now trying the fi...

php-dev Solved
WH
asked 1 month ago by which1ispink
0 votes
1 ans
3 views
How can I fix "unsupported class file major version 60" in IntelliJ IDEA?

I have a [Gradle][1] project in Ubuntu. It's written in Java 14. I have the Java 14 JDK installed. When I build it from the command line, everything work...

php-dev Solved
MA
asked 1 month ago by Mason Wheeler
0 votes
1 ans
3 views
How to add link in to array value ?

is there any simple way to create new array with extra value ? $table->data = array( array('Harry Potter', '76%', 'Gettin...

php-dev Solved
MO
asked 1 month ago by Mo.
0 votes
1 ans
3 views
php how to output arabic characters on windows using powershell

I have the below PHP script <?php header('Content-Type: text/html; charset=utf-8'); $file = "//192.168.10.206/wwwroot/SABI...

php-dev Solved
AN
asked 1 month ago by Anthony
0 votes
1 ans
3 views
Reference Guide: What does this symbol mean in PHP? (PHP Syntax)

### What is this? This is a collection of questions that come up now and then about syntax in PHP. This is also a Community Wiki, so everyone is invited to p...

php-dev Solved
GO
asked 1 month ago by Gordon
0 votes
1 ans
3 views
Deleting an element from an array in PHP

Is there an easy way to delete an element from an array using PHP, such that `foreach ($array)` no longer includes that element? I thought that setting it to...

php-dev Solved
BE
asked 1 month ago by Ben
0 votes
1 ans
3 views
How do I check if a string contains a specific word?

Consider: $a = 'How are you?'; if ($a contains 'are') echo 'true'; Suppose I have the code above, what is the...

php-dev Solved
CH
asked 1 month ago by Charles Yeung
0 votes
1 ans
3 views
How do you parse and process HTML/XML in PHP?

How can one parse HTML/XML and extract information from it?

php-dev Solved
RO
asked 1 month ago by RobertPitt
0 votes
1 ans
3 views
How does PHP 'foreach' actually work?

Let me prefix this by saying that I know what `foreach` is, does and how to use it. This question concerns how it works under the bonnet, and I don't want a...

php-dev Solved
DA
asked 1 month ago by DaveRandom
0 votes
1 ans
3 views
How do I get PHP errors to display?

I have checked my PHP ini file (`php.ini`) and `display_errors` is set and also error reporting is `E_ALL`. I have restarted my Apache webserver. I have even...

php-dev Solved
AB
asked 1 month ago by Abs
0 votes
1 ans
3 views
str_starts_with and str_ends_with functions in PHP

How can I write two functions that would take a string and return if it starts with the specified character/string or ends with it? For example: $str...

php-dev Solved
AL
asked 1 month ago by Ali
0 votes
1 ans
3 views
Sort a 2d array by a column value

How can I sort this array by the value of the "order" key? Even though the values are currently sequential, they will not always be. Array...

php-dev Solved
ST
asked 1 month ago by stef
0 votes
1 ans
3 views
Get the first element of an array

I have an array: `array( 4 => 'apple', 7 => 'orange', 13 => 'plum' )` I would like to get the first element of this arr...

php-dev Solved
HS
asked 1 month ago by hsz
0 votes
1 ans
3 views
How do you use bcrypt for hashing passwords in PHP?

Every now and then I hear the advice "Use bcrypt for storing passwords in PHP, bcrypt rules". But what is `bcrypt`? PHP doesn't offer any such...

php-dev Solved
VI
asked 1 month ago by Vilx-
0 votes
1 ans
3 views
Enumerations on PHP

I know that PHP doesn't yet have native Enumerations. But I have become accustomed to them from the Java world. I would love to use enums as a way to give p...

php-dev Solved
HE
asked 1 month ago by Henrik Paul
0 votes
1 ans
3 views
How can I sanitize user input with PHP?

Is there a catchall function somewhere that works well for sanitizing user input for SQL injection and XSS attacks, while still allowing certain types of HTML t...

php-dev Solved
BR
asked 1 month ago by Brent
0 votes
1 ans
3 views
Secure hash and salt for PHP passwords

It is currently said that MD5 is partially unsafe. Taking this into consideration, I'd like to know which mechanism to use for password protection. This...

php-dev Solved
LU
asked 1 month ago by luiscubal
0 votes
1 ans
3 views
PHP array delete by value (not key)

I have a PHP array like so: $messages = [312, 401, 1599, 3, ...]; Given that **the values in the array are unique**, how can I delete the element with...

php-dev Solved
AD
asked 1 month ago by Adam Strudwick
0 votes
1 ans
3 views
How do I expire a PHP session after 30 minutes?

I need to keep a session alive for 30 minutes and then destroy it.

php-dev Solved
TO
asked 1 month ago by Tom
0 votes
1 ans
3 views
What is stdClass in PHP?

Please define what `stdClass` is.

php-dev Solved
KE
asked 1 month ago by Keira Nighly