Skip to content
Advertisement

How can I add commas to numbers in PHP

I would like to know how can I add comma’s to numbers. To make my question simple. I would like to change this: To: and : to and so on for larger numbers. Is it possible with a php function? Answer from the php manual http://php.net/manual/en/function.number-format.php I’m assuming you want the english format. my 2 cents

any real MVC library in PHP (for GUI apps)

I’m wondering if there are any abstraction frameworks for one of the PHP gui libraries. We have PHP-GTK, a PHP/Tk interface, and seemingly also PHP-QT. (Not tried any.) I know that writing against …

PHP using an array in a Validation Class

On my site I have my register page, where a user inputs his information to register to my site. When he does the I process the user inputted information. Now when processing it I’m using arrays to facilitate the process, and not have me write the same code over and over. For example, here is how I gather the user

REST API – why use PUT DELETE POST GET?

So, I was looking through some articles on creating REST API’s. And some of them suggest using all types of HTTP requests: like PUT DELETE POST GET. We would create for example index.php and write API this way: OK, granted – I don’t know much about web services (yet). But, wouldn’t it be easier to just accept JSON object through

How can I comment out PHP lines inside HTML file?

In the middle my HTML code, I have a line of PHP. now, I want to make PHP line as a comment. I tried to ues <!– –> but it seems not work for PHP. What should I do? Thanks Answer Imagine you have the following code: If you want the div to be echoed but not displayed at the

Working with an array with periods in key values

I’m getting data from an array. For some reason the array has key values like [3.3] which I’m having trouble retrieving data from. I have this array [3.3] => First Name [3.6] => Last Name[2] => email@example.com. When I try to call $array[3.3] it returns null, but when I call $array[2] I am given the e-mail. Any ideas? Answer Use

Quickest Way to Read First Line from File

What’s the quickest, easiest way to read the first line only from a file? I know you can use file, but in my case there’s no point in wasting the time loading the whole file. Preferably a one-liner.

Advertisement