Category "php"

how do i retrieve and display the alt text of an image in wordpress?

how do i retrieve and display the alt text of an image in wordpress? trying to substitute the title for the alt. here is the original code. <?php while ( ha

PHP: remove filename from path

Say I have an path: images/alphabet/abc/23345.jpg How do I remove the file at the end from the path? So I end up with: images/aphabet/abc/

Can I write PHP code across multiple lines per statement?

Is it okay to write code like this, with statements spanning across multiple lines? $db_selected = mysql_select_db( 'my_dbase', mysql_connect(

Yii Ajax Submit button

Yii 1.1.14 I'm trying to make a popup to select a year and then get some reporting output for the selected year : The popup is generated by CJuiDialog. Insi

How to get values inside <![CDATA[values]] > using php DOM?

How can i get values inside <![CDATA[values]] > using php DOM. This is few code from my xml. <Destinations> <Destination>

Why does codeigniter & Linux server throws unserialize() session data error when user tries to login

I am developing an app using CodeIgniter and I have deployed this app on a linux server, the issues I am facing is this error ERROR - 2022-01-06 11:48:16 -->

Return new collection without modifying original collection

I have a Laravel collection and I want to modify one of its property value to negative integer. For this I am using the collection map method but it also modify

Cannot load imagick library

I have installed the imagick from here (ImageMagick-7.0.3-1-Q16-x64-dll) and the dll (TS 32 bit) from here. And also copiend the CORE_RL_* to the C:\xampp\apach

How can I get a div content in php

I have a div in php(string) and I want to get the content. for example: <div id="product_list" style="width:100%; float:none;"> <div>

Laravel Gates using model and returns "Using $this when not in object context" Line 28 of AzureUser model

Im trying to create a Gate in Laravel. The idea is to check if one of the roles is present on an AzureAD access token. So far I have this Gate::define('admin_cm

PHP SoapClient: set a namespace without prefix

I'm consuming a WSDL SOAP service using PHP's SoapClient. Here's the relevant bits of the WSDL: https://gist.github.com/jurchiks/03771c0b85683969bc48711e5669391

Converting array to string and then back in PHP

I created a array using PHP $userarray = array('UserName'=>$username,'UserId'=>$userId,'UserPicURL'=>$userPicURL); How can I convert this array into

Getting public posts of a random user from Facebook API

I want to get the latest posts of some random users (public posts of curse). I figured since they are public posts I don't need to ask permission from the owner

How to call a function inside of another function in PHP OOP

I'm making my own custom CMS using PHP Object Oriented... I have made a page where a main admin of a site can add another admin. In order to do this I made this

phpunit - testing is painfully slow

I am diving deeper and deeper in the world of unit testing. One issue I encountered, and this is where I would like feedback, is when one runs multiple test su

Reload parent page after submit in iframe

I have the same issue as in this question. (which has no correct answer, I just test all of them): Reload page after submit in iframe (javascript/jquery) What I

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource [duplicate]

I am getting the following error message on the code below (which is at the end of the query): Warning: mysql_num_rows(): supplied argument i

Laravel 4 Redirect::back() not going to previous page (refreshing current page)

I have a simple Lavel 4 project and I am trying to do a simple redirect to the previous page after the information has been submitted. However, when inserting R

netbeans problem : localhost/­PhpProject1/­index.­php not found

I have installed netbeans6.9.1 with java,c++ and php on windows 7. When i tried to run a test php code, the browser cant find the localhost. Pleas help me to g

Show Custom Data in Woocommerce Order Details Admin Area

When a User Buys a Product he can generate up to 3 Serial Keys for his Product. This works fine so far. The User can see his Serials always in "my account" The