php

  • How to insert php variables into less? 2019-03-21

    For days I've been looking all over the internet for a way to dynamically create a less file, into which I would pass color and font variables set inside the wordpress theme customizer api. The closest thing I came up with is a way to insert these va

    Tags: php, wordpress, less, twitter bootstrap, lessphp
  • MySQLi Array in PHP sometimes coming up empty 2019-03-21

    Okay, so I'm pretty much at the end of my rope trying to discover the issue here, because sometimes this code works perfectly, and then sometimes not, so here it is: $allItems = array(); $allItemsQuery = mysqli_query($conn,"SELECT * FROM cart_items W

    Tags: php, arrays, mysqli
  • Iterate values of Associative array if it has one object or more 2019-03-18

    My Problem is, I have set of arrays $people =[{name:'Alan', hasChild:true}, {name:'Alice', hasDetail:true}]; And other one is $people =[{name:'Alan', hasChild:true}]; I need to print all elements. I have tried in below way for($i=0; $i<count($people)

    Tags: php, arrays, associative array
  • zlib_decode() data error

    zlib_decode() data error 2019-03-16

    I've been struggling to install/configure Composer for about 3 days, and I'm totally lost: I type composer install and it produced: After I type composer diagnose & reading a lot of articles without knowing exactly what I'm reading about, I conclude

    Tags: php, composer php
  • move_upload_file uploading old file? 2019-03-15

    I'm working on an "Edit post" page which allows users to upload a picture to replace their old picture (displayed at the bottom of the post). Here's the code: if (isset($_FILES['pic']['tmp_name']) && $_FILES['pic']['name']!=NULL) { $targ

    Tags: php, file
  • Create 2 dimensional merged array based value 2019-03-14

    I have an array in the following format, Array ( [0] => Array ( [expense_id] => 7 [type] => frfrf [mode] => rfr [amount] => 100 [tran_type] => expense [date] => 2015-06-29 ) [1] => Array ( [expense_id] => 8 [type] => frfrf [m

    Tags: php, mysql, arrays
  • Keep multi-character delimiter 2019-03-06

    I have a string $string = "hi!n!my!n!name!n!is!n!bob"; I want to split it by the '!n!' I've tried something like: $splitstring = preg_split("!n!", $string,-1, PREG_SPLIT_DELIM_CAPTURE); but it removes all instances of 'n' instead of !n

    Tags: php
  • RegEx troubles with converting text to links 2019-03-05

    I'm trying to make my shoutbox automatically convert posted data into links if it matches certain criteria. It works, except not if there is more than one link in a single shoutbox post. Here is my code that is meant to convert it: <? $text = "edi

    Tags: php, regex
  • How do I remove/hide specific parts of my Wordpress url? 2019-03-04

    My current URL is below. I'm using a custom php function to pass three GET variables to the page "world": http://wordpress.dev/hello/world/?one=Volvo&two=Ford&three=Chevy How can I make my URL look like this? http://wordpress.dev/hello/w

    Tags: php, .htaccess, wordpress, get, permalinks
  • if statement with multiple or condition 2019-03-03

    Consider the following code if ( stripos($a,'something1')===0 || stripos($a,'something2')===0 ) { return ''; } Is there a performance benefit for using in_array or does php stops testing if first condition evaluate to true ? --------------Solutions--

    Tags: php, if statement
  • MySQL: multiple columns or tables 2019-03-02

    I'm working with MySQL and PHP in a web HTML5 using websockets with many data linked with multiples tables by id, but each table have 3 items, some 5, but I need to know what is better, work with leftjoin and link all tables using the id, or put all

    Tags: php, mysql
  • Set a timeout for both connect and read in file_get_contents 2019-03-01

    Prerequisites Cluster server I have a server that runs a number of virtual "cluster nodes". Basically, each one of them is a public, very minimal HTTP server, that has two functions: 127.0.0.1:XXXXn/ping 127.0.0.1:XXXXn/api/arg/arg/arg Both of t

    Tags: php, curl, file get contents
  • Can't insert into database using data manipulation API-Moodle 2019-02-28

    I'm trying to insert data from a form into the database when a user clicks on the save button but i'm getting these error messages: Notice: Undefined index: name in C:\moodleFile\server\moodle\local\try\process.php on line 5 Notice: Undefined index:

    Tags: database, php, moodle
  • [PHP][Youtube api v3] retrieving the informations for a single video 2019-02-28

    I'm getting some trouble with the youtube api. I would like to retrieve the informations from a single video. What I already got : i can get videos from a specified playlist with all their informations (like the title, the description etc) i get the

    Tags: php, video, api, youtube
  • Single url variable with multiple values into array 2019-02-27

    This question already has an answer here: How can I split a comma delimited string into an array in PHP? 3 answers I have a url with a single variable (category), but the variable has multiple values. Example: http://websiteurl.com/?category=cat+dog+

    Tags: php, arrays, variables, urlvariables
  • Difference between sqlsrv_fetch_array and sqlsrv_fetch_object 2019-02-27

    Im working with PHP and MS SQL Server 2005 and 2012 , my question is what is the Difference between sqlsrv_fetch_array and sqlsrv_fetch_object , which one is better option for get one row and then editing? if(isset($_POST['editvalue'])) { $query_ed =

    Tags: php, sql server, json
  • Auto tick checkboxes from database 2019-02-25

    So I have a loop of catagories from the cat table in my database which works fine and show them as available checkboxes. I need a way to show 'checked' checkboxes when I go in and make an edit so I need it to read the table and know which categories

    Tags: php, mysql
  • Output failure (No Output!) in PHP if umlaut/mutation in String 2019-02-25

    If i read a text from Database, which contains ü, ö, ä, and so on -> my function gives NO output. Its not so easy to check errors because its a WebHook called script. Example (like my function): function foo() { global $db_link; $output = "Names:

    Tags: php, mysql
  • Warning: mysqli_error() expects exactly 1 parameter, 0 given in function from a server with PHP 2019-02-24

    well i have an issue and i hope that all of you can help me a bit :). My problem´s. I have 2 clases to work on-line with my server, let call them DB and recipe, what i want is one time you are in the inside of my app i have some kind of filters to se

    Tags: php, mysql, sql
  • echoing a checkbox inside an echoed form 2019-02-23

    I have an echo of a form and for the echo of a radio button I use this: //works fine. value='0' ";if ($row["werkverwijder"] == '0') { echo "checked"; } for a textarea I use this: //works fine. ".$row["overmij"].&quo

    Tags: php

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.227 (s). 7 q(s)