Skip to content
Advertisement

Tag: php

Anonymize IPv4 and IPv6 addresses with PHP preg_replace?

I needed to anonymize IPv4 and IPv6 addresses so I coded this crude solution: It works fine with full length IPv4 and IPv6 addresses like 207.142.131.005 2001:0db8:0000:08d3:0000:8a2e:0070:7344 but not with abbreviated addresses like 207.142.131.5 2001:0db8::8d3::8a2e:7:7344 I wonder if there is an elegant solution with preg_replace and some regular expression magic? Answer No conditional is necessary. You can write two patterns

Laravel dump() unexpected output

Using Laravel 5.5.34, I have trouble outputting debug information in Blade templates using the dump() helper. results in the following output: I wouldn’t expect the raw string “test” to show up below the actual debug output. Is this the normal behavior and if yes, how can I disable it? If no, what misconfiguration could cause it? Answer Digging a little

How to get video from Instagram public access API?

I know that this api is working to get images but how about videos? https://www.instagram.com/username/?__a=1 I was able to get the thumbnail of the video but not the source or the url itself. Answer When you make above API call it would return code in it. looks something like this: BWhyIhRDBCw Whenever your media nodes has “is_video”: true you can

Json_encode returns json cells as string

I’ve got a database structure like this. I’m willing to get row as a json object for Json.net. My php code is this I’m getting json as this. As you can see, subscriptions value is string. I need it to be array as it seems. Is there any way to achieve this. ? Thanks a lot ! Answer The way

Video upload stop working – Youtube API

I use a PHP script to upload some daily videos to a Youtube channel (based on this code sample: https://developers.google.com/youtube/v3/code_samples/php#resumable_uploads) The problem is after this loop: Normally the $status variable has the video id ($status[‘id’]) after the upload is complete but since mid January all the uploads failed with one of this errors: $status variable value stills as “false” Inside

How to send multiple radio button values in tab form

HTML: JS PHP Query is below: I use multiple tab form in HTML and use javascript and PHP to send all values to an email. please review the code above. I received this email: Zipcode: Question1: Question2: Question3: Section one is HTML Code, Section two is Javascript and section three is Php code here! Answer

Advertisement