There is this class that gets added into the cart totals in the checkout process to signify updates being made as the user is inputting relevant information such as a shipping address. When that …
How to convert Hex to binary in PHP?
I’m trying to send 0x01 HEX as Byte using the socket_write($socket, XXXX , 1); function. There is part of documentation: “…If yes, server will reply to module 0x01, if not – replay 0x00. Server must send answer – 1 Byte in HEX format.” Answer There are multiple alternatives: When using…
lastInsertId() for UPDATE in Prepared Statement
The code above does not work. The value I am trying to get is primary key auto increment. As lastInsertId() suggests by its name, it may be intended for insert only. If so, what is the proper way to achieve the same goal on an UPDATE? The value I wish to return is the primary key of the table, if
PHP Mysqli add subtract number format
HI just found a solution about add and sustract two columns here but I need to make the php code to format the numbers. Here is the solution I got here: <?php while ($row= mysqli_fetch_assoc($…
Split string into 2 letters
I am trying to split a string into 1, 2 and 3 segments. For example, i currently have this: Which works well on 1 character splitting, I get: However when I try: I get: Is there a way so that I can output this? : and then also with 3 characters like this? Answer Here it is: PHPFiddle Link: http://phpfiddle.or…
CryptoJS encrypts AES with passphrase but PHP decrypt needs a key
I am using CryptoJS to encrypt a string: As I understand it, CryptoJS uses the passphrase to generate a key, which is then used to encrypt the data. However I’d like to decrypt the cipher using a PHP function, or maybe an online tool such as this: http://aesencryption.net/ The issue is that these expect…
zf2 change language dynamically
I have one question, about ZF2 Translator, in the specific case in the costruction the link for change langauge dunamically when user click on flag or menu link. In My Application/config/module.config.php i have this code: and my route is: And in my Application/Module.php i set this code on bootstrap: now my …
How to add PHP pagination in array’s
I’ve been trying a lot of ways to add PHP pagination. I have tried searching and trying to figure other ways of implementing the pagination but none of them work. Here’s how I created the Index page: I would like to know how I can paginate the the array list. Thanks! Answer u can use simple PHP fu…
Mysqli class not found. Using percona, php5-fpm, nginx, phalcon
Fatal error: Class ‘TKStdlibmysqli’ not found in /var/www/tk-browser-app/application/library/tk-stdlib/DbAbstract.php on line 28 It sounds like I need mysqli installed. Yea I know, but it says it’s …
Pico CMS custom header
Im trying to include dynamc custom header in PicoCMS. Simple “include ‘header.php’;” wont work since the theme have only index.html file and and I cant include PHP in it. My guess is I would have to make a custom plugin for this to work but Im not shure how to do it. They have some doc…