I’ve using Google Cloud API and I’ve created instance but without IPv4. I need instance with IPv4. Can anyone help me to config AccessConfig? I think I missed something like this: Can anyone help me? Source: https://github.com/googleapis/google-cloud-php/tree/master/Compute/src/V1 And: https://git…
Tag: php
User’s cant upload images on published website
I have a website which you can upload pictures and see them. I was uploading and gettin pictures with no problem on localhost but after publishing with freewebhostingarea i get these errors. Warning: move_uploaded_file(img/pexels-garvin-st-villier-3874337.jpg): failed to open stream: Permission denied in /hom…
PHP change file extension in HTML as plaintext
I want to change file extension in HTML code on PHP output. Probably with regex and this is something I really cannot handle.. …some code…<img data-src=’https://static.example.com/gallery/image.jpg’>…some code… should be changed to …some code…<img data-…
Cluster PHP array
Let’s say I have an array of items with each item a value. I’d like to create a new array where the items are clustered by their relative distance to each other. When an item has a distance of one to another item, they belong to each other. This will create an output of overlapping arrays. What I …
PHP Split XML based on multiple nodes
I honestly tried to find a solution for php, but a lot of threads sound similar, but are not applicable for me or are for completely different languages. I want to split an xml file based on nodes. Ideally multiple nodes, but of course one is enough and could be applied multiple times. e.g. I want to split th…
Compare values from a single array with multiple series of arrays, then echo the result
With the following script I am able to calculate the frequency of every number from 10 different arrays, then echoes the result sorting the numbers in frequency classes (ex. values that appear one time : x, y, z , values that appear two times : a, b, c, ….etc.) My problem : I would like to calculate the…
Symfony mocking repository for testing
I’m trying to mock a repository containing all modules, and it has a method called findAll() that returns all elements from that repository. I cant seem to be able to pull any data from the mocked repository. Any ideas how I could fix it? Mocking repository: Trying to use method from ModuleRepository cl…
PHP getting TIME difference in hours and minutes format
I’m currently new to PHP , and I am stuck on this problem. I cant seem to subtract the TIME IN from employee SCHEDULE PS: I also tried date_diff method, but it doesn’t work on me. THis is what my database looks like Answer I got the answer, i did it like this. Example: shiftstart 08:30:00AM and ti…
How to hide/not display PDF title in the toolbar
Is there any way to access metadata of PDF file I embedded using pdfobject.js? I would like to replace/change its title because it’s not corresponding to its filename. example is the snip below. filename of that is ‘D1000SPN.pdf’ which is different from the title displaying. I tried to searc…
SQLSTATE[HY000]: General error: 1005 Can’t create table `school`.`posts` (errno: 150 “Foreign key constraint is incorrectly formed”)
before everything, I tried hard many websites and forums to solve this problem until these posts related to this problem in StackOverflow, but I can’t solve the problem. I want to create to one to many relationship between Post and Category model but I get that error code. SQLSTATE[HY000]: General error…