Category "php"

phpseclib 2.0 can not use Composer to create autoload

I work for a company that has our servers and computer locked down tighter than ... well imagine something really tight. This means I can not use composer or in

WHM Enabling mod_rewrite

I have a CentOS 6.8 w/ WHM on GoDaddy and I have a laravel application. The routes don't work, they return a 404 Not found and because of this I'm assuming it's

How to MODIFY a Google Docs document via API using search-and-replace?

I need an example of how to modify an existing document with existing text in Google Docs via API. The documentation only shows how to insert and delete text, b

Make survey at laravel 5.4 and MySQL

I need to make a survey for my website. I have this: Route: Route::resource('survey','surveyController'); Controller: public function index() { $show=surve

Split array into 4-element chunks then implode into strings

$array = [1, 2, 3, 4, 5, 6, 7, 8, 9]; I want output like ['1, 2, 3, 4', '5, 6, 7, 8', '9'];

Substitute integers and dots with regex [duplicate]

I have the following string and I need to substitute the numbers and dot with a star: FOO_BAR_FOOBA_1_R:FOO_1.0 I tried the following but I j

How to insert data from multiple select dropdown values into database?

I have a multiple select dropdown with checkbox. But I am not sure how to insert it into database and the next time the page opens, it displays the current valu

passing an array to web-service php nusoap

i have a problem with passing an array to a web-service function that i created with php and nusoap. the problem is that i guess i'm doing something wrong.. i s

Log a user out of a website when they put their computer to sleep

This is a bizarre one. We have a Laravel website, and on said site we have a timer per user, where they get 15 minutes of being inactive before being booted. W

Merge key and value of array index [duplicate]

I have an array as follows: ['foo'=>'bar','baz'=>'bat'] im trying to determine an elegant way (not using a standard forloop, prefer lea

Printing more than one array using print_r or any other function in php

I need to print contents of multiple arrays in my code. Eg function performOp($n, $inputArr, $workArr) { printf("Entered function, value of n

preventing abuse of API service usage

I am planning on using Laravel in my next web project, for the backend. Using the Laravel's built-in functionality I will build an API service. So my main conce

Best way to send email to clients from e-commerce website?

I'm building e-commerce website that will sell all kind of items, what is the best way to send emails to clients? Our selling department will send a lot of em

Wordpress 'post_type_link' hides permalink

So I just added a custom post type through the WP-Types plugin, nothing fancy just a custom post type. Now the permalink of this custom post type isn't showing

jQuery Ajax Post with data

why it isn't working. Am trying to call a php file when onclick of a button occurs with some parameters. It is getting executed till alert statement in jsfile.j

PHP Pure functions

I am trying to identify pure functions in PHP code. A pure function is one where both these statements about the function hold: The function always evaluates

Facebook PHP SDK - will not logout properly

I've been searching for hours for the solution to this problem but can't find one that works for me. When i click "Logout" on my site the user information is st

sqlsrv_num_rows() expects parameter 1 to be resource, boolean given

Having an issue with sqlsrv_query. This is the error I get: PHP Warning: sqlsrv_num_rows() expects parameter 1 to be resource, boolean given Here is the relev

Php, reflection, how to remove "final" declaration?

I want to test a class which is declared: "final class testme" and cannot be mocked. How to remove the "final" keyword with reflections?

Saving Data from form to database using AngularJS and php

I'm pretty new in angular. i created a modal window to user share story and after that show it in body: html <button class="btn btn-primary new-story" n