LMSouq

Knowledge Base

Browse Moodle Solutions

Clear

2110 solutions found in plugin-api

Page 11 of 106
0 votes
2 ans
33 views
How to execute a background process?

I need to execute a directory copy upon a user action, but the directories are quite large, so I would like to be able to perform such an action without the use...

general-dev Solved
TI
asked 5 months ago by tim
0 votes
3 ans
30 views
Add a custom attribute to a Laravel / Eloquent model on load?

I'd like to be able to add a custom attribute/property to an Laravel/Eloquent model when it is loaded. For instance, at the moment, in my controller I ha...

php-dev Solved
CO
asked 5 months ago by coatesap
0 votes
3 ans
22 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 5 months ago by Gorep
0 votes
3 ans
28 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 5 months ago by Sarfraz
0 votes
3 ans
32 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 5 months ago by I am the Most Stupid Person
0 votes
3 ans
29 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 5 months ago by user1206970
0 votes
3 ans
32 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 5 months ago by Andrei Oniga
0 votes
2 ans
34 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 5 months ago by omg
0 votes
3 ans
31 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 5 months ago by roflwaffle
0 votes
3 ans
34 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 5 months ago by Joe
0 votes
2 ans
31 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 5 months ago by Willy Keatinge
0 votes
2 ans
30 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 5 months ago by Alessandro Minoccheri
0 votes
2 ans
30 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 5 months ago by jantimon
0 votes
3 ans
27 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 5 months ago by omg
0 votes
3 ans
29 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 5 months ago by Jrgns
0 votes
2 ans
35 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 5 months ago by 夏期劇場
0 votes
2 ans
32 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 5 months ago by Asim Zaidi
0 votes
3 ans
31 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 5 months ago by Hrishikesh -Rishi- Choudhari
0 votes
3 ans
33 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 5 months ago by Josh
0 votes
2 ans
33 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 5 months ago by Imran