LMSouq

Knowledge Base

Browse Moodle Solutions

2108 solutions found

Page 14 of 106
0 votes
1 ans
3 views
How can I send an email using PHP?

I am using PHP on a website and I want to add emailing functionality. I have [WampServer][1] installed. How do I send an email using PHP? [1]: https:...

php-dev Solved
US
asked 1 month ago by user590849
0 votes
1 ans
3 views
Why is textarea filled with mysterious white spaces?

I have a simple [text area][1] in a form like this: <textarea style="width:350px; height:80px;" cols="42" rows="5" name=...

general-dev Solved
AF
asked 1 month ago by Afamee
0 votes
1 ans
3 views
Tracking the script execution time in PHP

PHP must track the amount of CPU time a particular script has used in order to enforce the max_execution_time limit. Is there a way to get access to this i...

php-dev Solved
TW
asked 1 month ago by twk
0 votes
1 ans
3 views
How to convert an image to Base64 encoding

How can I convert an image from a URL to Base64 encoding?

general-dev Solved
VO
asked 1 month ago by Volatil3
0 votes
1 ans
3 views
Interface or an Abstract Class: which one to use?

Please explain when I should use a PHP `interface` and when I should use an `abstract class`? How I can change my `abstract class` in to an `interface`?

php-dev Solved
US
asked 1 month ago by user220758
0 votes
1 ans
3 views
Converting string to Date and DateTime

If I have a PHP string in the format of `mm-dd-YYYY` (for example, 10-16-2003), how do I properly convert that to a `Date` and then a `DateTime` in the format o...

php-dev Solved
CH
asked 1 month ago by Chris Pinski
0 votes
1 ans
3 views
List of All Locales and Their Short Codes?

I'm looking for a list of all locales and their short codes for a PHP application I am writing. Is there much variation in this data between platforms? A...

general-dev Solved
KI
asked 1 month ago by Kirk Ouimet
0 votes
1 ans
3 views
How to get last key in an array?

How can I get the last key of an array?

php-dev Solved
AJ
asked 1 month ago by ajsie
0 votes
1 ans
3 views
How to remove duplicate values from a multi-dimensional array in PHP

How can I remove duplicate values from a multi-dimensional array in PHP? Example array: Array ( [0] => Array ( [0] => abc...

php-dev Solved
IA
asked 1 month ago by Ian
0 votes
1 ans
3 views
How can I handle the warning of file_get_contents() function in PHP?

I wrote a PHP code like this $site="http://www.google.com"; $content = file_get_content($site); echo $content; But when I remove &...

php-dev Solved
WA
asked 1 month ago by Waseem
0 votes
1 ans
3 views
Deleting all files from a folder using PHP?

For example I had a folder called `Temp' and I wanted to delete or flush all files from this folder using PHP. Could I do this?

php-dev Solved
GE
asked 1 month ago by getaway
0 votes
1 ans
3 views
cURL error 60: SSL certificate: unable to get local issuer certificate

I am trying to send an API request using Stripe but get the error message: > cURL error 60: SSL certificate problem: unable to get local issuer certificat...

server-admin Solved
LO
asked 1 month ago by LoveAndHappiness
0 votes
1 ans
3 views
How do I read any request header in PHP?

How should I read any header in PHP? For example the custom header: `X-Requested-With`.

php-dev Solved
SA
asked 1 month ago by Sabya
0 votes
1 ans
3 views
How to enable PHP short tags?

I have a web application on a Linux server which starts with `<?` I needed to copy this application to a windows environment and everything is working fin...

php-dev Solved
SE
asked 1 month ago by seedg
0 votes
1 ans
3 views
Cannot simply use PostgreSQL table name ("relation does not exist")

I'm trying to run the following PHP script to do a simple database query: $db_host = "localhost"; $db_name = "showfinder";...

database Solved
KE
asked 1 month ago by Keyslinger
0 votes
1 ans
3 views
Remove new lines from string and replace with one empty space

$string = " put returns between paragraphs for linebreak add 2 spaces at end "; Want to remove all new lines from st...

php-dev Solved
JA
asked 1 month ago by James
0 votes
1 ans
3 views
List all files in one directory PHP

What would be the best way to list all the files in one directory with PHP? Is there a $_SERVER function to do this? I would like to list all the files in the u...

php-dev Solved
SH
asked 1 month ago by Shadowpat
0 votes
1 ans
3 views
break out of if and foreach

I have a foreach loop and an if statement. If a match is found I need to ultimately break out of that foreach and if. foreach($equipxml as $equip) {...

general-dev Solved
AU
asked 1 month ago by au_stan
0 votes
1 ans
3 views
Accurate way to measure execution times of scripts

I want to know how many milliseconds a PHP *for* loop takes to execute. I know the structure of a generic algorithm: ```lang-none Begin init1 = timer();...

general-dev Solved
DO
asked 1 month ago by DomingoSL
0 votes
1 ans
3 views
Convert flat array to a delimited string to be saved in the database

What is the best method for converting a PHP array into a string? I have the variable `$type` which is an array of types. $type = $_POST[type]; I...

database Solved
PH
asked 1 month ago by Philip Kirkbride