Changing the sign of a number in PHP?

PHP
Hay Guys, I have quick question. I have a few floats: -4.50 +6.25 -8.00 -1.75 How can I change all these to negative floats so they become: -4.50...
3 years ago

How to read this JSON using PHP?

PHP
I'm very new with JSON format, and in the tutorials I read I don't understand well how to parsed using php. So I have this: { "type": "FeatureCol...
3 years ago

How to properly escape html form input default values in php?

PHP
Given the following two html/php snippets: <input type="text" name="firstname" value="<?php echo $_POST['firstname']; ?>" /> and <te...
3 years ago

Alter all occurence of href values with php

PHP
i want to change all the values of href tag before submitting them to database. Lets say i have a paragraph with some anchor tags in it and i want to...
3 years ago

How to check if a multiple user-inputs are NOT empty

PHP
I tried to build a function that can check a set of strings for me and find out whether its empty strings ("") or not, So after playing around for som...
3 years ago

php issues with include

PHP
I have checked around here and the internet but I could not solve my issue: First off, I am using the php include command to include files from other...
3 years ago

how can I define variable in .htaccess file and use it?

PHP
I have defined an htaccess file for my website having this code: RewriteEngine on RewriteBase / RewriteRule ^bit_auth\/?(.*)$ /cig/base3/auth/$1 [R=...
3 years ago

How to get values from complex object in php

PHP
I am working with the Google Calendar API, trying to get the ids from the response object. Here is the object. Google_Service_Calendar_CalendarList ...
3 years ago

PHP: Elegant Way To Output This Array

PHP
I'm over complicating the output of this example array, what is the cleanest, most elegant way you would do this for the desired output. Array Ex: A...
3 years ago

Text input limiting to less than 31 (days)

PHP
I want to use text input to ask for day in a form, but i dont know how to use this pattern attribute well. Maybe i should use some those regex with le...
3 years ago

PHP conditional echo text instead HTML

PHP
I'm trying to create a conditional for a theme in a Wordpress, If the meta exist show this... else show that. <?php $scene_trailer = get_post_...
3 years ago

add an onChange function to this dynamically populated select field to echo result to a textfield

PHP
I checked the boards and Googled for this code but couldn't find anything. Any help would be greatly appreciated. I have worked through a tutorial...
3 years ago

Function not printing out anything

PHP
I have the following function below: public function setupHead($title){ $displayHead .='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict/...
3 years ago

How to get the video thumbnail from Dailymotion video from the video id of that video like in youtube?

PHP
For youtube I use something like this: <img class="video-thumbnail" src="http://img.youtube.com/vi/<?php echo $video_id; ?>/0.jpg" alt="" wi...
3 years ago

How to alias the name of a column in Eloquent

PHP
I have an eloquent model named Eloquent: Products::where("actice", "=", true)->get()->toArray(); Now I want to add join-statement to it, I ha...
3 years ago

PHP creates two files at a time with different files names but with the same content

PHP
The goal is to create a repository of a custom session files. When I use this code to write data to a session file, php creates two files with differe...
3 years ago

using joins or multiple queries in php/mysql

PHP
Here i need help with joins. I have two tables say articles and users. while displaying articles i need to display also the user info like username, e...
3 years ago

how to define global constants in codeigniter in constants.php

PHP
I have stored my global constants in config->constants.php but it creating problem and throwing error I have defined it like this, how to call it in c...
3 years ago

MVC & RewriteRule isn't working at all

PHP
I have built a website with a homemade MVC structure and pretty urls with .htaccess aren't working at all. I have this "front controller" (index.php) ...
3 years ago

Remove first 4 characters of a string with PHP

PHP
How can I remove the first 4 characters of a string using PHP?
3 years ago