I have the necessity to store many numbers (i can decide which numbers) as a single unique number from which i should be able to retrieve the original number. I already know 2 ways to do this: 1) Fundamental theorem of arithmetic (Prime Numbers) Say
i am using PHP as Modal, and Angularjs as Controller, and to display in front end, I am converting PHP into JSON. It displays like as below shown in Front End. I want to display a readable one with li tag and break tag and other texts only. I don't w
I have a problem when I try concatenate variables with a URL This works: $id = 123; $url = file_get_contents("http://127.0.0.1:8080/api/table.json?output=html&udptype=trap&udpmsgid=".$id."&content=udpmessage"); But this doe
How can I randomise items in the array and loop them? {% for item in article.resources|shuffle|slice(1) %} ... {% endfor %} I get this error: Unknown "shuffle" filter in "partials/content.twig" at line 30. If I use random(): {% for ite
I'm trying to make hidden input and set some value in blade template but it isn't hidden and is visible on the page. This is the field {{ Form::hidden('price', '<?php echo $item['price'] * $item['quantity'];?>') }} I have tried without <?php ?>
I have a couple of order item meta details that I would not like the customer to see (on the view orders page under account info). I have found a filter that will remove this data from the ADMIN (where I would still like to see it), but can't find a
In my project I used an image cropper widget. I setup the widget, that it save in frontend/web/upload. But in backend I save the images to frontend too. This is working perfect. Then i want to show the image on the backend, if its exist. And i want t
I got a string like 1(8()3(6()7())9()3())2(4())3()1(0()3()) which is representing a tree. A bracket appears, if we go one level deeper. Numbers on the same level are neighbours. Now want to add nodes, for example I want to add a 5 to every path where
I got a menu I want to make dynamic with joomla (so i can add an article under a certain category, the category being the top menu level, and that article is shown in a dropdown under the category). This is some of the basic information I used to try
Ok, so I've used the following php code to try to get youtube to return a users list of videos, however, their "items" is coming up as empty. $apiKey = "MY-API-KEY"; $channel_name = "UCSzDPMGFGxDgM4YtNM4arTA"; $count = 1; $ap
I have got this code from one of the site for file downloads. Did implemented this code but it only gets download but when I tried to view the file it shows me error in the file. I did downloaded various file formats like pdf, docx ,doc but it always
Hello i have a sql statement that ranks my records and inserts the ranks into a database. The problem i am having is that when i run the script. It deletes the old rankings. And inserts the new rankings fine, but it inserts every ranking twice. So th
I am making an ajax call on submit button click event to check field validations server side. When I get a validation fail, ajax response gives the proper error message, returns false, and stops the form to submit to the action url. But when I get a
How foreach this array to < a href="path-to-jpg-file">name< /a> Array ( [0] => Array ( [0] => 01-siena-rosso-new.jpg [1] => Siena Rosso ) [1] => Array ( [0] => 02-siena-noce-new.jpg [1] => Siena Noce ) [2] => Arr
I have a byte array in pdf format getting from web service.Now I want to view in PDF file but no luck. sample byte[]: JVBERi0xLjQKJeLjz9MKMSAwIG9iaiAKPDwKL01hdHJpeCBbMSAwIDAgMSAwIDBdCi9TdWJ0eXBlIC9Gb3JtCi9GaWx0ZXIgL0ZsYXRlRGVjb2RlCi9MZW5ndGggMTUwMzc3
I have a php page in which i use $_GET to get a variable from a previous page. So in this page I have declared it example $id=$_GET['id']; $car=$_GET['car']; And then I have some php functions which uses this variable. So the url to this page looks s
I'm using both PHP and Javascript to build some kind of web service. I try to validate a token calculated on post parameters, sent from JS to PHP. Let's say the code is as follows: JS : token = JSON.stringify(params); PHP : token = json_encode($_POST
Using the Google Maps API v3, I'd like to take the map center coordinates and construct a URL based on them that would send a user to an external mapping site. Constructing the URL is not the problem, however keeping the URLs updated as the map moves
I am facing a problem, that may be placed on programmers.stackexchange.com, too, but since it's pretty tied to Doctrine and ZF2, i chose to put it up on here. Let me introduce you to my scenario: I have an Application where Users post Entities (BaseE
So, I want to change @ sign from this preg match: [A-Z0-9._%+-]
[email protected][A-Z0-9.-]{3,65}\.[A-Z]{2,4} to (at) string, how make this work ;/ cant figure out.I believe you are looking for ideone Demo $your_string = str_replace('@', '(at)', $your_string); or if
Though I'm not so specific about session_id(), i am using a code in php like this in a.php i'm using this code $_SESSION['sid']=session_id(); when i'm in b.php, i am echoing the session sid and then unsetting it like this.. echo $_SESSION['sid']; uns
I'm using the ToroPHP for routing. Docs: https://github.com/anandkunal/ToroPHP/blob/master/README.md Source: https://github.com/anandkunal/ToroPHP/blob/master/src/Toro.php My code: Toro::serve(array( "/" => "home", )); Toro::serve(a
This refers to one of my previous questions: array_unique vs array_flip - This states that array_flip(array_flip()) is much quicker than array_unique() when dealing with simple strings and integers. What I would like to know is why array_unique() cre
I have implemented a function in a singleton class with an optional parameter. private function MyFunction($Name = "") { $localCopy = $Name; //this check fails, EMPTY is printed! if (empty($Name)) echo "EMPTY"; else echo "NOT EMPT
I have multiple If statements that if true, inserts data into the db. The Problem is that the 2nd one of the INSERT statements inserts it 4 times. How would i stop it from adding duplicates. Also the returned $_POST['tshirt'] contains only one value
Hopefully a quickie... I'd like to know how/where to alter the settings in argouml that is used in autocode generation. Files created have extra things in that I don't need (some comments, some code like e.g. version checking flow control) and includ
I'm building a website with a homepage that has a different article everyday. I know how to change it using html, but that requires daily maintenance. Is there anyway I can change a picture and text daily without changing code everyday? I'd also like
I have one table ( members ) and five columns ( username , password , FirstName , LastName , Email ) I need to get the Email for the user admin. How would this be done? SELECT Email FROM members WHERE username = 'admin';
I have received this database full of people names and data in French, which means, using characters such as é,è,ö,û, etc. Around 3000 entries. Apparently, the data inside has been encoded sometimes using utf8_encode(), and sometimes not. This result
I have found this tutorial online http://net.tutsplus.com/tutorials/php/creating-a-php5-framework-part-1/ I have created myself a simple sort of framework, but I have not been too knowledgeable whether I have followed best practices and the like... w