LMSouq

Knowledge Base

Browse Moodle Solutions

Clear

366 solutions found in php-dev

Page 5 of 19
0 votes
3 ans
31 views
Is it possible to delete an object's property in PHP?

If I have an `stdObject` say, `$a`. Sure there's no problem to assign a new property, `$a`, $a->new_property = $xyz; But then I want to remo...

php-dev Solved
VA
asked 5 months ago by valk
0 votes
2 ans
37 views
Convert DateTime to String PHP

I have already researched a lot of site on how can I convert PHP DateTime object to String. I always see "String to DateTime" and not "DateTime...

php-dev Solved
NE
asked 5 months ago by Netorica
0 votes
3 ans
35 views
Setting Curl's Timeout in PHP

I'm running a curl request on an eXist database through php. The dataset is very large, and as a result, the database consistently takes a long amount of ti...

php-dev Solved
MO
asked 5 months ago by Moki
0 votes
3 ans
35 views
How to check if a value is in a multidimensional array

I use `in_array()` to check whether a value exists in an array like below, $a = array("Mac", "NT", "Irix", "Linux&quot...

php-dev Solved
RU
asked 5 months ago by Run
0 votes
1 ans
30 views
Split string by new line characters

I have a string with new line characters. I want to convert that string into an array, and for every new line, jump one index place in the array. If the stri...

php-dev Solved
JO
asked 5 months ago by Johan
0 votes
3 ans
36 views
Best way to allow plugins for a PHP application

I am starting a new web application in PHP and this time around I want to create something that people can extend by using a plugin interface. How does one...

php-dev Solved
WA
asked 5 months ago by Wally Lawless
0 votes
2 ans
21 views
Composer install error - requires ext_curl when it's actually enabled

I'm trying to install Facebook PHP SDK with Composer. This is what I get $ composer install Loading composer repositories with package informati...

php-dev Solved
MI
asked 5 months ago by Michal Artazov
0 votes
2 ans
37 views
PHP Redirect with POST data

I did some research on this topic, and there are some experts who have said that it is not [possible](https://stackoverflow.com/questions/3045097/php-redirect-a...

php-dev Solved
SH
asked 5 months ago by Shiro
0 votes
3 ans
31 views
What is <=> (the 'Spaceship' Operator) in PHP 7?

PHP 7 introduced the Spaceship (&lt;=&gt;) operator. What is it and how does it work?

php-dev Solved
DE
asked 5 months ago by Deepak Mankotia
0 votes
2 ans
36 views
Adding days to $Date in PHP

I have a date returned as part of a MySQL query in the form `2010-09-17`. I would like to set the variables $Date2 to $Date5 as follows: `$Date2 = $Date +...

php-dev Solved
IS
asked 5 months ago by Istari
0 votes
3 ans
35 views
Converting timestamp to time ago in PHP e.g 1 day ago, 2 days ago...

I am trying to convert a timestamp of the format `2009-09-12 20:57:19` and turn it into something like `3 minutes ago` with PHP. I found a useful script to d...

php-dev Solved
WI
asked 5 months ago by willdanceforfun
0 votes
3 ans
34 views
Creating PHP class instance with a string

I have two classes, `class ClassOne { }` and `class ClassTwo {}`. I am getting a string which can be either `&quot;One&quot;` or `&quot;Two&quot;`. Instead o...

php-dev Solved
JO
asked 5 months ago by Joel
0 votes
3 ans
29 views
Add a custom attribute to a Laravel / Eloquent model on load?

I&#39;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
31 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
28 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
2 ans
33 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
30 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&#39;s [`in_array`](http://www.php.net/in_arr...

php-dev Solved
RO
asked 5 months ago by roflwaffle
0 votes
2 ans
30 views
What does "->" or "=>" mean in PHP?

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

php-dev Solved
WI
asked 5 months ago by Willy Keatinge
0 votes
2 ans
29 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
3 ans
26 views
How do I get the function name inside a function in PHP?

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

php-dev Solved
OM
asked 5 months ago by omg