I am getting the image url from one function. I need to find the extension for the image. Sometimes the image url comes with parameters like http://slimages.macys.com/is/image/MCY/products/4/optimized/1776484_fpx.tif?$filterlrg$&wid=370. So, the file extension comes like tif?$filterlrg$&wid=370. How c…
Tag: php
Should I be unit testing every piece of code
I have been starting unit testing recently and am wondering, should I be writing unit tests for 100% code coverage? This seems futile when I end up writing more unit testing code than production code. I am writing a PHP Codeigniter project and sometimes it seems I write so much code just to test one small fun…
How can I get ID of entity in form type?
I have form type for build form of category: class CategoryType extends AbstractType { /** * @param FormBuilderInterface $builder * @param array $options */ public function …
connecting to mysql via ipaddress with MySQL and mysqli
I have weird problem. I don’t have a domain name for my remote mysql database, so on my development machine I usually just connect to a remote mysql using the ip address. On my development machine the ip address connection works for both mysql and mysqli connections. However, when I upload to my live se…
Codeigniter or_where_in
I am trying to combine these two queries in Codeigniter. So the row either has to have the user_id of $user eg 3 OR have an id matching the array $repost. I know how to do or_where but how do you do or_where_in? Thanks Answer Syntax: Parameters: Returns: Return type: Generates a WHERE field IN(‘item’, ‘item’)…
When using composer with a private VCS it infinitely asks for authorization
In my composer.json i have a private vcs repository: When i call php composer.phar update i get the following: Doesnt matter how many time I put in my my github credentials it keeps asking. If i put in incorrect ones it does the same thing, no errors or max attempts. Any ideas what would cause this? I am usin…
PHP/HTML: Mobile website to desktop website using mobile device
I’ve expanded my website by adding a ‘mobile device detector’ to it, so that is will send you to a different page when you’re using a mobile device (check it out here, and for the mobile version here (of course it will automatically send you there when using a mobile device if you clic…
How to remove both .php and .html extensions from url using NGINX?
I want my nginx make display all url’s clean. http://www.mydomain.com/indexhtml.html as http://www.mydomain.com/indexhtml http://www.mydomain.com/indexphp.php as http://www.mydomain.com/indexphp With some research I’ve made the first case to work. It`s done by following configuration: It works for…
Output HTML table elements separated by commas in PHP
My code strips td elements from an html table and outputs them in a single line. Here is an html table my code extracts td values from: My code that takes these td values and outputs them on their own line. Keep in mind this is only one table of many in my .html file. Here is my code: The
Radio buttons checked changing submit text
My site structure consists on an index.php which is styled by a css file. It then includes the following php code in a separate file: It appears on screen with no problems in the correct layout as my css style sheet. What I would like this to do is when I select the “Subscribe” radio button the su…