LMSouq

Knowledge Base

Browse Moodle Solutions

2108 solutions found

Page 8 of 106
0 votes
1 ans
3 views
Can you "compile" PHP code and upload a binary-ish file, which will just be run by the byte code interpreter?

I know that PHP is compiled to byte code before it is run on the server, and then that byte code can be cached so that the whole script doesn't have to be r...

php-dev Solved
CA
asked 1 month ago by Carson Myers
0 votes
1 ans
3 views
What is the point of interfaces in PHP?

[Interfaces](http://php.net/Interfaces) allow you to create code that defines the methods of classes that implement it. You cannot however add any code to those...

php-dev Solved
MK
asked 1 month ago by mk.
0 votes
1 ans
3 views
Cannot pass null argument when using type hinting

The following code: ```php class Type { } function foo(Type $t) { } foo(null); ``` failed at run time: > PHP Fatal error: Argument 1...

general-dev Solved
AB
asked 1 month ago by Abdullah
0 votes
1 ans
3 views
Converting a UNIX Timestamp to Formatted Date String

Using PHP, I want to convert UNIX timestamps to date strings similar to this: `2008-07-17T09:24:17Z` How do I convert a timestamp such as `1333699439` to `20...

php-dev Solved
UT
asked 1 month ago by Utku Dalmaz
0 votes
1 ans
3 views
How are echo and print different in PHP?

> **Possible Duplicate:** > [Reference: Comparing PHP's print and echo](https://stackoverflow.com/questions/7094118/reference-comparing-phps-pr...

php-dev Solved
ZU
asked 1 month ago by zuk1
0 votes
1 ans
3 views
PHP - Failed to open stream : No such file or directory

In PHP scripts, whether calling `include()`, `require()`, `fopen()`, or their derivatives such as `include_once`, `require_once`, or even, `move_uploaded_file()...

php-dev Solved
VI
asked 1 month ago by Vic Seedoubleyew
0 votes
1 ans
3 views
Guzzlehttp - How get the body of a response from Guzzle 6?

I'm trying to write a wrapper around an api my company is developing. It's restful, and using Postman I can send a post request to an endpoint like `ht...

general-dev Solved
GR
asked 1 month ago by Greg
0 votes
1 ans
3 views
PHP - Move a file into a different folder on the server

I need to allow users on my website to delete their images off the server after they have uploaded them if they no longer want them. I was previously using the...

server-admin Solved
OD
asked 1 month ago by odd_duck
0 votes
1 ans
3 views
Generating a random password in php

I am trying to generate a random password in php. However I am getting all 'a's and the return type is of type array and I would like it to be a str...

php-dev Solved
NU
asked 1 month ago by nunos
0 votes
1 ans
3 views
Get the client IP address using PHP

I want to get the client IP address who uses my website. I am using the PHP `$_SERVER` superglobal: $_SERVER['REMOTE_ADDR']; But I see it can...

php-dev Solved
US
asked 1 month ago by user1752627
0 votes
1 ans
3 views
What is Autoloading; How do you use spl_autoload, __autoload and spl_autoload_register?

I am learning advanced PHP standards and trying to implement new and useful methods. Earlier I was using `__autoload` just to escape including multiple files on...

general-dev Solved
XK
asked 1 month ago by xkeshav
0 votes
1 ans
3 views
how to bypass Access-Control-Allow-Origin?

I'm doing a ajax call to my own server on a platform which they set prevent these ajax calls (but I need it to fetch the data from my server to display retr...

general-dev Solved
ET
asked 1 month ago by ETAN
0 votes
1 ans
3 views
How to read GET URL parameter?

I'm trying to pass a URL as a URL parameter in PHP but when I try to get this parameter I get nothing I'm using the following URL form: http:/...

general-dev Solved
FE
asked 1 month ago by Feras Odeh
0 votes
1 ans
3 views
Advantages/disadvantages of using cookies to store a user ID?

For the sake of creating a login system for my website, I read about cookies and sessions and their differences (cookies are stored in the user's browser an...

general-dev Solved
NA
asked 1 month ago by Nadjib Mami
0 votes
1 ans
3 views
Get value from SimpleXMLElement Object

I have something like this: $url = "http://ws.geonames.org/findNearbyPostalCodes?country=pl&placename="; $url .= rawurlencode($city[$i...

general-dev Solved
KU
asked 1 month ago by kubas
0 votes
1 ans
3 views
What is output buffering in PHP?

What is output buffering and why would you use it in PHP?

php-dev Solved
AB
asked 1 month ago by Abhimanyu
0 votes
1 ans
3 views
Sending POST data in Android

I'm experienced with PHP, JavaScript and a lot of other scripting languages, but I don't have a lot of experience with Java or Android. I'm look...

general-dev Solved
OM
asked 1 month ago by OMGKurtNilsen
0 votes
1 ans
3 views
Are PHP Variables passed by value or by reference?

Are PHP variables passed by value or by reference?

php-dev Solved
CM
asked 1 month ago by cmcculloh
0 votes
1 ans
3 views
PHP - concatenate or directly insert variables in string

I am wondering, What is the proper way for inserting PHP variables into a string? <br/><br/> **This way:**<br/> echo "Welcome &q...

php-dev Solved
WE
asked 1 month ago by Web_Designer
0 votes
1 ans
3 views
Remove warning messages in PHP

I have some PHP code. When I run it, a warning message appears. How can I remove/suppress/ignore these warning messages?

php-dev Solved
AL
asked 1 month ago by Alireza