LMSouq

Knowledge Base

Browse Moodle Solutions

2108 solutions found

Page 11 of 106
0 votes
1 ans
3 views
How do I log errors and warnings into a file?

How do I turn on all error and warnings and log them to a file, but to set up all of that within the script (not changing anything in php.ini)? I want to def...

general-dev Solved
GO
asked 1 month ago by Gorep
0 votes
1 ans
3 views
Is there any particular difference between intval and casting to int - `(int) X`?

Is there any particular difference between intval and (int)? Example: $product_id = intval($_GET['pid']); $product_id = (int) $_GET['...

general-dev Solved
SA
asked 1 month ago by Sarfraz
0 votes
1 ans
3 views
Is there way to use two PHP versions in XAMPP?

We are running XAMPP with PHP 7.0 because our new products requires PHP 7. But there are old projects which use functions like `mysql_connect`, etc. Those ar...

php-dev Solved
I
asked 1 month ago by I am the Most Stupid Person
0 votes
1 ans
3 views
Simplest two-way encryption using PHP

What is the simplest way of doing two way encryption in common PHP installs? I need to be able to encrypt data with a string key, and use the same key to dec...

php-dev Solved
US
asked 1 month ago by user1206970
0 votes
1 ans
3 views
How to save a PNG image server-side, from a base64 data URI

I'm using Nihilogic's "Canvas2Image" JavaScript tool to convert canvas drawings to PNG images. What I need now is to turn those base64 strin...

server-admin Solved
AN
asked 1 month ago by Andrei Oniga
0 votes
1 ans
3 views
How do I get a file name from a full path with PHP?

For example, how do I get `Output.map` **from** `F:\Program Files\SSH Communications Security\SSH Secure Shell\Output.map` with PHP?

php-dev Solved
OM
asked 1 month ago by omg
0 votes
1 ans
3 views
JavaScript equivalent of PHP's in_array()

Is there a way in JavaScript to compare values from one array and see if it is in another array? Similar to PHP's [`in_array`](http://www.php.net/in_arr...

php-dev Solved
RO
asked 1 month ago by roflwaffle
0 votes
1 ans
3 views
file_get_contents(): SSL operation failed with code 1, Failed to enable crypto

I’ve been trying to access this particular REST service from a PHP page I’ve created on our server. I narrowed the problem down to these two lines. So my PHP...

server-admin Solved
JO
asked 1 month ago by Joe
0 votes
1 ans
3 views
What does "->" or "=>" mean in PHP?

I see these in PHP all the time, but I don't have a clue as to what they actually mean. What does `->` do and what does `=>` do? And I'm not ta...

php-dev Solved
WI
asked 1 month ago by Willy Keatinge
0 votes
1 ans
3 views
How to convert an stdClass to an array?

I have a problem to convert an object stdClass to array. I have tried in this way: return (array) $booking; or return (array) json_decode($b...

php-dev Solved
AL
asked 1 month ago by Alessandro Minoccheri
0 votes
1 ans
3 views
How to get the jQuery $.ajax error response text?

I am sending an error response to my jQuery. However, I can not get the response text (in the example below this would be **Gone to the beach**) The only th...

database Solved
JA
asked 1 month ago by jantimon
0 votes
1 ans
3 views
How do I get the function name inside a function in PHP?

Is it possible? function test() { echo "function name is test"; }

php-dev Solved
OM
asked 1 month ago by omg
0 votes
1 ans
3 views
Can PHP PDO Statements accept the table or column name as parameter?

Why can't I pass the table name to a prepared PDO statement? $stmt = $dbh->prepare('SELECT * FROM :table WHERE 1'); if ($stmt->exe...

php-dev Solved
JR
asked 1 month ago by Jrgns
0 votes
1 ans
3 views
How do you Encrypt and Decrypt a PHP String?

What I mean is: Original String + Salt or Key --> Encrypted String Encrypted String + Salt or Key --> Decrypted (Original String) Maybe som...

php-dev Solved
asked 1 month ago by 夏期劇場
0 votes
1 ans
3 views
How can I get parameters from a URL string?

I have an HTML form field `$_POST["url"]`, having some URL strings as the value. Example values are: <pre> https://example.com/test/1234?...

php-dev Solved
AS
asked 1 month ago by Asim Zaidi
0 votes
1 ans
3 views
How to install and run phpize

I have been meaning to install `ffmpeg` as an extension to my PHP setup. So before I can install it, I need to `phpize` it. I installed `php5-dev` by `sudo apt-...

php-dev Solved
HR
asked 1 month ago by Hrishikesh -Rishi- Choudhari
0 votes
1 ans
3 views
Laravel 4: how to "order by" using Eloquent ORM

Simple question - how do I order by 'id' descending in Laravel 4. The relevant part of my controller looks like this: $posts = $this->post-...

php-dev Solved
JO
asked 1 month ago by Josh
0 votes
1 ans
3 views
What are namespaces?

What are PHP Namespaces? What are Namespaces in general? A Layman answer with an example would be great.

general-dev Solved
IM
asked 1 month ago by Imran
0 votes
1 ans
3 views
How to remove unused dependencies from composer?

I installed a package with composer, and it installed many other packages as dependencies. Now I uninstalled the main package with `composer remove packageau...

php-dev Solved
LO
asked 1 month ago by Lorenz Meyer
0 votes
1 ans
3 views
Safely remove migration In Laravel

In Laravel, there appears to be a command for creating a migration, but not removing. Create migration command: php artisan migrate:make create_users_...

php-dev Solved
GL
asked 1 month ago by Globalz